This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes public class with default subclass? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "public class with default subclass?" Watch "public class with default subclass?" New topic
Author

public class with default subclass?

Nicole Roesner
Greenhorn

Joined: Dec 14, 2002
Posts: 2
Can a public class have a subclass with no modifier (default)?
Thanks!!
Mellihoney Michael
Ranch Hand

Joined: Nov 27, 2002
Posts: 124
yes
but it doesn't make sense, don't you think so???


a beginner in java
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8805
    
    5
Nicole -
Is your question:
public class Test { }
class Sub extends Test {}
??

This is legal and fine, what are you wondering about? What problem do you see ?


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: public class with default subclass?
 
Similar Threads
Default constructor
can a default class be subclassed?
What Inheritance Actually Do
A small doubt
Default Constructor