Single Choice Not Set

QWhat will be the output for the below code ?
public interface TestInf{
      int i =10;
}

public class Test{
      public static void main(String... args){
            TestInf.i=12;
	    System.out.println(TestInf.i);
      }
}

ID: #2288 Java Interfaces And Abstract Classes MCQ 1,404 views
Question Info
#2288Q ID
Not SetDifficulty
Java Interfaces And Abstract Classes MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Compile with error
  • B 10
  • C 12
  • D Runtime Exception
Correct Answer

Explanation

Compile with error

Share This Question

Challenge a friend or share with your study group.