Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

public class with default subclass?

 
Nicole Roesner
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a public class have a subclass with no modifier (default)?
Thanks!!
 
Mellihoney Michael
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes
but it doesn't make sense, don't you think so???
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic