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 Programmer Certification (SCJP/OCPJP) and the fly likes Packages 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Packages" Watch "Packages" New topic


putti don

Joined: Jul 28, 2005
Posts: 20
I have created a package by name P1 with two files in the package with a single class in each file. One of the class is a public class(say A). I want to inherit this class A into another class B, which is in the other file of the same package.But when i try to compile "" i am getting error like cannot resolve symbol A.

Is it not possible to inherit a class of one file into another class of another file with both files being in the same package?

Arulkumar Gopalan
Ranch Hand

Joined: Oct 13, 2003
Posts: 104
It is very much possible to inherit a public class from any package.

Here is your case:

You must compile with -d option.
LocationOfYourJavaFiles$javac -d . *
This would create appropriate directory and put the class files there.

Anbudan & Mahalo,<br />Arul<br /> <br />-Not a sun certified Java professional :-)
I agree. Here's the link:
subject: Packages
Similar Threads
Need Help in compiling package
EJB extends another EJB?
Problem in compilation with classpath of jar file
Query -> inheritance
protected member subclassing