For these two cases, are there any implicit modifiers applied to the declaration(i.e. an interface member variable is implicitly "public static final")? Thanks in advance.
Joined: Mar 05, 2003
Member interfaces declared in a class are always implicitly static. JLS 8.5.2 Member classes and interfaces declared in an interface are always implicitly static and public. JLS 9.5
Joined: May 13, 2003
take a look at this posting if you read and understand the basics here, it will help you with your question. But basically you can declare a class within an interface, since an interface is defined as 'static abstract', what this mean is that a classes declared within the interface will be treated as a top level nested class. here is a sample code to show how to declared a class bar inside an interface foo and then use it. just make sure you understand the difference between a class and an interface, and that you understand inner classes and nest classes, this will clear up the question for you.... read the previous posting and look at the java sun tutorial s it explains the diff between an interface and class
NOTE: class bar1 is declared with a defult access modifier class bar2 had a public access modifier class bar3 is an abstract class which is extended by class foobar3 notice how class scoping is used to extend class foobar3 [ May 15, 2003: Message edited by: Rajinder Yadav ]
When faced with an easy thing to do and a hard thing to do, always pick the right thing to do!<p><a href="http://yadav.shorturl.com" target="_blank" rel="nofollow">Rajinder Yadav</a>