Multiple Choice
Which of the following class definitions is correct in Java? (i) public class Employee {private String name; private double salary; private int id; public Employee() {name = ""; salary = 0.0; id = 0;} public Employee(String n, double s, int i) {name = n; salary = s; id = i;} public void print() {System.out.println(name + " " + id + " " + salary) ;}} (ii) public class Employee {private String name; private double salary; private int id; public void Employee() {name = ""; salary = 0.0; id = 0;} public void Employee(String n, double s, int i) {name = n; salary = s; id = i;} public void print() {System.out.println(name + " " + id + " " + salary) ;}}
A) Only (i)
B) Only (ii)
C) Both (i) and (ii)
D) Neither is correct
Correct Answer:

Verified
Correct Answer:
Verified
Q8: The built-in operation that is valid for
Q9: In _ copying, each reference variable refers
Q10: Which of the following words indicates an
Q11: Suppose that Book is class with two
Q12: What might the heading of the copy
Q14: Modifiers are used to alter the behavior
Q15: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB8472/.jpg" alt=" -Which of the
Q16: Classes that are defined within other classes
Q17: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB8472/.jpg" alt=" -According to the
Q18: When no object of the class type