Multiple Choice Question

Quiz Guidelines

 

QID: 
381
Question: 

What, if anything, is wrong with the following code?

// Filename: TestClass.java 

class TestClass implements T1, T2{   
public void m1(){} } 
interface T1{  
 int VALUE = 1;   
void m1(); } 
interface T2{   
int VALUE = 2;  
 void m1(); }

Select 1 option

A. TestClass cannot implement them both 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 one of the interfaces. 
D. The code will work fine only if m1() is removed from one of the interfaces. 
E. None of the above. 

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!