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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
image
Computers and Technology, 23.06.2019 20:00, shadow6728g
How much current flows through the alternator brushes? a. 2–5 a b. 25–35 a, depending on the vehicle c. 5–10 a d. 10–15 a
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, kevin72836
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
image
Computers and Technology, 25.06.2019 04:00, saggirl1209
Use the wrap text icon to modify which graphic appears in the front of layered images modify the picture effects change the way text is wrapped around an object apply wordart to the text
Answers: 1
You know the right answer?
Which of the following class definitions is correct in java? (i)public class student{private string...

Questions in other subjects:

Konu
History, 12.03.2021 19:30
Konu
Mathematics, 12.03.2021 19:30
Konu
Mathematics, 12.03.2021 19:30
Konu
Mathematics, 12.03.2021 19:30
Konu
Mathematics, 12.03.2021 19:30