• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

plz explain

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Given the following class definition.
class A{
protected int i;
A(int i) {
this.i = i;
}
}
Which of the following would be a valid inner classes for this class? Select all valid answers.
a) class B{}
b) class B extends A {}
c) class B{
B() {
System.out.println("i = " + i);
}
}
d) class B{
class A {}
}
e) class A{}
Can any body explain plz why the valid answers are only (a) & (c) and other are not.
Thnx.
 
reply
    Bookmark Topic Watch Topic
  • New Topic