Question
What is the expected output?
public class Profile {
private Profile(int w) { // line 1
System.out.print(w);
}
public final Profile() { // line 5
System.out.print(10);
}
public static void main(String args[]) {
Profile obj = new Profile(50);
}
}
public class Profile {
private Profile(int w) { // line 1
System.out.print(w);
}
public final Profile() { // line 5
System.out.print(10);
}
public static void main(String args[]) {
Profile obj = new Profile(50);
}
}
Answer: Option B
Submit Your Solution Below and Earn Points !
Submit Your Solution Below and Earn Points !
More Questions on This Topic :
Question 8. The implicit return type of a constructor is....
Question 10. The main method should be static for the reason....
Submit Solution