aspose file tools
The moose likes Beginning Java and the fly likes public class with default subclass? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 8439
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 ?


Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
 
IntelliJ Java IDE
 
subject: public class with default subclass?
 
Threads others viewed
can a default class be subclassed?
Default constructor
What Inheritance Actually Do
A small doubt
Default Constructor
developer file tools