Home / Programming MCQs / JAVA MCQs / Question

J

Jatin Dubey • 3.72K Points
Extraordinary

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

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.