Discussion :: Declarations and Access Control - Pointing out the correct statements (Q.No.1)
Sushil said: (Dec 17, 2013) | |
How 3 and 5 is correct as in 3 interface name is AllMath and in the 5 abstract class also name is AllMath? How it is possible to have same name in the same package? |
Tomnguyen said: (Dec 24, 2013) | |
@Sushil: agree, but I think it means we can put either 3 or 5 to the end of code and it still runs. |
Harshvardhan said: (Jun 13, 2015) | |
How can in option 3 a class can extends an interface? Interface can not be extended but can be implemented. |
Alam said: (Dec 13, 2015) | |
@Harshvardhan. One interface can extend another interface. |
Abc said: (Jul 4, 2016) | |
I think correct answer is 3 Only. 5 is wrong : AllMath implements DoMath, MathPlus. Here method getVol with body is missing. |
Vikram said: (May 12, 2018) | |
I think correct answer is 3 Only. In option 5, 'AllMath' is declared as an abstract class but does not contain even a single abstract method defined. |
Kundan said: (May 28, 2019) | |
How the return type will be different in option 2? |
Nikhil said: (Jul 19, 2021) | |
5th option is right because class is abstract. |
Riblad said: (Nov 14, 2021) | |
Option 3 is wrong, because an interface cannot implement another interface. |
Post your comments here:
Name *:
Email : (optional)
» Your comments will be displayed only after manual approval.