This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes doubt : class defined inside an interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "doubt : class defined inside an interface" Watch "doubt : class defined inside an interface" New topic
Author

doubt : class defined inside an interface

Pankaja Shinde
Ranch Hand

Joined: Sep 15, 2006
Posts: 87
Mock Exam question

Which of the following are true about the class defined inside an interface

1. it is not possible in the java Laungage.
2. The class is always public.
3. The class is always static.
4. the class methods cannot call the methods declared in the interface.
5. the class methods can call only the static methods declared in the interface.

Answer 2 3 4

I think answer should be 3 & 5.

Please explain me

Pankaj Shinde
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Pankaja,

Interfaces can't have any methods declared as static. So innerclasses declared inside interface ,accessing static methods is not possible at all.
 
GeeCON Prague 2014
 
subject: doubt : class defined inside an interface