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, 23.06.2019 12:30
How is the brightness of oled of the diaplay is controled
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
question
Computers and Technology, 24.06.2019 08:00
Can someone work out the answer as it comes up in one of my computer science exams and i don't understand the cryptovariables
Answers: 1
You know the right answer?
Which of the following class definitions is correct in java? (i)public class student{private string...
Questions
question
Mathematics, 05.12.2021 23:20
question
Mathematics, 05.12.2021 23:20
question
Mathematics, 05.12.2021 23:20
question
Mathematics, 05.12.2021 23:20