Constructors

If a class Student creates two student objects. Which of the following statements are true about its constructors?

A: The compiler can call to super() in any constructor that has a call to this().
B: If a constructor is not declared in the code, a default constructor will be automatically generated by the compiler.
C: Constructors can be overridden.
D: The compiler cannot call to super() in any constructor that has a call to this()

ANSWERS:

  • Share/Bookmark

class Ques{
public static void main (String[] argv){
int p1 = 0102;
int p2 = -10;
int mod = p1 % p2;
System.out.println(”mod = ” +mod);
}
}

  • Share/Bookmark