• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Regarding Top level Nested interface

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below is one of the answers in JQPlus ( Question Id : 953578810580 )
> A top-level nested interface can contain static member variables

Now typically an interface contains static variables and non-static method prototypes. Does the above answer refer to the variables only or
rather what does it mean by "can contain static member variables" ?
The explanation further gives an example as :
public interface I1{
public void mA();
public interface Inner1
{
int k=10;
public void innerA();
}
}
Here from above the Inner1 is implicitly static.
What is the use of declaring the interface within another interface and why does it become implicitly static ? Ofcourse the usage like
I1.Inner1 is known but i am still not clear ?
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic