Posted By:
nitin_kale
Posted On:
Sunday, December 19, 2004 02:12 AM
There are 2 packages,having one java file.I have inherited a class from one package to another.My Super class gets compiled but not the sub class.It gives me the error package not found,what should I do? //file Question37Super.java package A; public class Question37Super { protected int i=2; } //file Question37Sub.java package B; import A.*; public class Question37Sub extends Question37Super { public static void main(String[] args){ Question37Sub q37sub = new Question37Sub(); q37sub.goFetch(); } public void goFetch(){ System.out.println("in goFetch(): i=&qu
More>>
There are 2 packages,having one java file.I have inherited a class from one package to another.My Super class gets compiled but not the sub class.It gives me the error package not found,what should I do?
//file Question37Super.java
package A;
public class Question37Super {
protected int i=2;
}
//file Question37Sub.java
package B;
import A.*;
public class Question37Sub extends Question37Super {
public static void main(String[] args){
Question37Sub q37sub = new Question37Sub();
q37sub.goFetch();
}
public void goFetch(){
System.out.println("in goFetch(): i="+i);
class GoFetchLocal{
public void goFetch(){
System.out.println("in GoFetchLocal.goFetch(): i="+i); //line 1
}
}
new GoFetchLocal().goFetch();
}
}
<<Less