Q What is the output of the following program?
interface G1
{
int i=1;
}
public class T1 implements G1
{
public static void main(
String args[])
{
T1 xyz=new T1();
System.out.println(T1.i); //please explain what happens ?
System.out.println(G1.i); // " ?
System.out.println(xyz.i); // " ?
}
}
A The program will fail to compile.
B The program will successfully compile but will throw runtime exception.
C Three 1's will be printed.
D Three 2's will be printed.