This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inheritance and package question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inheritance and package question" Watch "Inheritance and package question" New topic

Inheritance and package question

Bing Qiao

Joined: Oct 24, 2006
Posts: 21
How to extend a class B in a non-default package from another class A in default package?

package scjp;

Class B extends A {

It doesn't compile!

Many thanks!
[ October 25, 2006: Message edited by: Bing Qiao ]
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
How to import classes that are in the 'default' package?
Bing Qiao

Joined: Oct 24, 2006
Posts: 21
I agree. Here's the link:
subject: Inheritance and package question
Similar Threads
Access modifier question...
Doubt in accessing a method
access modifiers and inheritance
"The use of the default package is discouraged." Should I worry?