• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can an Inner Class be Public?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 25, it says an inner Class can be declared public, but there can be only one public class in a file.
Does it mean the outer Class cannot be declared public and the file name is same as the inner class?
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The actual rule is that there can be only one top-level public class in a file. Could you check back and see if page 25 actually says that? If not, please let us know what the book is.

And, welcome to the Ranch!
 
Hao Chen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:The actual rule is that there can be only one top-level public class in a file. Could you check back and see if page 25 actually says that? If not, please let us know what the book is.

And, welcome to the Ranch!



Thank you Paul.
It says "Member inner classes", so the book should be correct.
 
reply
    Bookmark Topic Watch Topic
  • New Topic