File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes class inside interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "class inside interface" Watch "class inside interface" New topic
Author

class inside interface

kanchan chaudhary
Greenhorn

Joined: Jun 06, 2001
Posts: 28
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
Thanks
kanchan
Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
1. False - it is possible. See JLS section 9.1.3.
2. True - according to JLS, "all interface members are implicitly public."
3. True
4. True - since the class is static, it can't make calls to non-static methods.
5. False - static methods may not be declared in an interface.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class inside interface
 
Similar Threads
class in interface!
doubt in interface??
class defined inside an interface
interface
Interface??