I have a Q? interface MyInterfce{ 1 int x=1; 2 } What can be added on line 2? Choose (Three) I choose 2, 5, 9, Is it right? I guess an interace can not have access modifier. native is only for method. I think I can't use abstract for variable. My guess final is right one? I still need to pick two more, so I choose 3, 9. Anybody figure out which one is right one? 1) public int x=1; 2)protected int x=1; 3)transit int x=1; 4)private int x=1; 5)final int x=1; 6)native int x=1; 7)abstract int x=1; 9)volatile int x=1;
Jane Griscti
Ranch Hand
Joined: Aug 30, 2000
Posts: 3141
posted
0
Hi Raju, If you try compiling the code with the various options you get the following results:
Note, you cannot continue to use 'x' as the variable name; doing so produces a compile errror 'x already defined'. Hope that helps. ------------------ Jane