Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Beginning Java
Private modifier and classes
Willie Toma
Ranch Hand
Posts: 78
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I thought that the base class was the only class that wasn't able to be considered private?
public class Base{ public final void amethod(){ System.out.println("amethod"); } } private class Fin extends Base{ public static void main(String argv[]){ Base b = new Base(); b.amethod(); } }
Manfred Leonhardt
Ranch Hand
Posts: 1492
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Willie,
The correct answer is that TopLevel classes can only be public or default (no access specified).
Translation:
Any non-inner class must not be private or protected.
Regards,
Manfred.
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Inheritance/Polymorphism question
anonumous class
few questions
anonumous class
question from Marcus Green's website tutorial
More...