public class Exc
{
public static void main(String args[])
{
int x1=0;
try {
int x3= 100/x1;
} catch(ArithmeticException e) {
System.out.println(”Illegal operation”);
} catch(RuntimeException e) {
System.out.println(”runtime error”);
return;
} catch(Exception e) {
System.out.println(”Exception found”);
} finally {
System.out.println(”Complete”);
}
System.out.println(”Successfully”);
}
}
What will be the output of the following program code?
Author: Daisy WilliamsNov 24
Constructors
Author: Daisy WilliamsNov 17
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: