• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Java Class and Object

Question 11

In Java, when we implement an interface method, it must be declared as:
  • Private
  • Protected
  • Public
  • Friend

Question 12

Predict the output of following Java program Java
class Test {
  int i;
} 
class Main {
  public static void main(String args[]) { 
      Test t = new Test(); 
      System.out.println(t.i);
   } 
}
  • garbage value
  • 0
  • compiler error
  • runtime error

There are 12 questions to complete.

Last Updated :
Take a part in the ongoing discussion