interface I
{
int i=1,ii=trial2.out("ii",2);
}
interface J extends I
{
int j=trial2.out("j",3),jj=trial2.out("jj",4);
}
interface K extends J
{
int k=trial2.out("k",5);
}
class
test {
public static void main (
String[] args)
{
System.out.println(J.i);
System.out.println(K.j);
}
static int out(String s,int i)
{
System.out.println(s +"=" +i);
return i;
}
}
output is
1
j=3
jj=4
3
i understand reason for the first three lines of output.but how come 3 is displayed.please explain?