Submitted by c-admin on Wed, 06/05/2019 - 02:15
What, if anything, is wrong with the following code?
interface T1{
}
interface T2{
int VALUE = 10;
void m1();
}
interface T3 extends T1, T2{
public void m1();
public void m1(int x);
}
Select 1 option
A. T3 cannot implement both T1 and T2 because it leads to ambiguity.
B. There is nothing wrong with the code.
C. The code will work fine only if VALUE is removed from T2 interface.
D. The code will work fine only if m1() is removed from either T2 and T3.
E. None of the above.
Submitted by c-admin on Wed, 06/05/2019 - 02:13
Consider the following interface definition:
public interface ConstTest{
public int A = 1; //1
int B = 1; //2
static int C = 1; //3
final int D = 1; //4
public static int E = 1; //5
public final int F = 1; //6
static final int G = 1; //7
public static final int H = 1; //8
}
Which line(s) will cause a compilation error?
Select 1 option
A. 1
B. 2
C. 3
D. 4
E. 5
F. 6
G. 7
H. 8
I. None of them will cause any error.
Pages