subject

Which of the following class definitions is correct in java? (i)public class student{private string name; private double gpa; private int id; public void student(){name = ""; gpa = 0; id = 0; }public void student(string s, double g, int i){set(s, g, i); }public void set(string s, double g, int i){name = s; gpa = g; id = i; }public void print(){system. out. println(name + " " + id + " " + gpa); }}(ii)public class student{private string name; private double gpa; private int id; public student(){name = ""; gpa = 0; id = 0; }public student(string s, double g, int i){set(s, g, i); }public void set(string s, double g, int i){name = s; gpa = g; id = i; }public void print(){system. out. println(name + " " + id + " " + gpa); }}1. both (i) and (ii)2. none of these3. only (ii)4. only (i)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 23.06.2019 11:50
While preforming before operation pmcs, you notice the front right tire appears slightly under-inflated. what is the proper action?
Answers: 3
question
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
question
Computers and Technology, 24.06.2019 23:00
Aselect query joins tables together by their a. table names. b. primary keys. c. first entries. d. field names.
Answers: 2
You know the right answer?
Which of the following class definitions is correct in java? (i)public class student{private string...
Questions
question
Mathematics, 07.04.2021 06:10
question
Mathematics, 07.04.2021 06:10
question
History, 07.04.2021 06:10
Questions on the website: 13722360