A

Admin • 828.03K Points
Coach

Q. The following program is an example for?

Code:
class Student{
int id;
String name;

void display(){System.out.println(id+" "+name);}

public static void main(String args[]){
Student s1=new Student();
Student s2=new Student();
s1.display();
s2.display();
}
}
  • (A) Parameterized constructor
  • (B) Default Constructor
  • (C) Overloading Constructor
  • (D) None of the above
  • Correct Answer - Option(B)
  • Views: 10
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.