This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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.
 
jQuery in Action, 2nd edition
 
subject: doubt : class defined inside an interface
 
Similar Threads
class inside interface
Doubt on Class defined inside an interface
Question on Interface
Interface??
class defined inside an interface