1.- XXX should be an interface,something1 and something2 need not, for the expression to be legal 2.- XXX should be a class, something1 and something2 must be interfaces for the expression to be legal. 3.- XXX, something1 and something2 must be interfaces for the expression to be legal. The above statement is alway illegal in Java as multiple inheritance is not supported. The correct answer is 3 but why is not 2??? I think that I see a lot of times a Class with 2 interfaces! Thakns in advance.
Hi Jordy, Classes in java can extend only one another class using extends clause and can implement 0(no implements clause),1 or more interface(s) through implements clause. But interfaces can extend one or more interfaces through extends clause. Hope this helps u.
Hi, Quote ----------------- Public XXXX extends something1, something2 // 1 ------------------- 1. XXXX can be a class and something1, something2 cannot be classes as in Java a class cannot extend more than one class. 2. XXXX can be a class and something1, something2 cannot be interfaces as they need to be implemented and cannot be extended. 3. XXXX can be an interface and something1, something2 can also be interfaces and in that case the statement //1 is legal. 4. Incidentally in java for interfaces multiple inheritance is allowed and hence statement //1 is legal. HTH any comments...welcome. tvs sundaram
She still doesn't approve of my superhero lifestyle. Or this shameless plug: