hello people!!!
i am having this problem while i am implementing inheritance in a package named"inherint" which is a sub-directory of the directory "shashikayubbi" !!!
i've a super class inhr.java,a derived class inher.java !!!
well the code runs completely ok when i am executing it from the directory "shashikayu bbi" , but when i put these files in the sub-dir "inherint" there is a problem at the time of compliling the code and the compiler responds "class:inhr not found"
"Please don't tell me about configuring the classpath variable coz i've tried it!!!"
so here the codes
inhr.java:
[code=java]
package inherint;
class inhr
{
int ssup;
public int inht1;
public int inht2;
public int inht3;
inhr(){}
public inhr(inhr o)
{
inht1=o.inht1;
inht2=o.inht2;
inht3=o.inht3;
}
inhr(int i,int j,int k)
{
inht1=i;
inht2=j;
inht3=k;
}
void disp()
{
System.out.prin t("I am in Super class");
System.out.prin tln("var values"+inht1+" "+inht2+" "+inht3);
}
}
[/code]
inher.java:
[code=jave]
package inherint;
class inher extends inhr
{
int inh;
int ssup;
inher(int i,int j,int k,int l)
{
super(i,j,k);
inh=l;
}
int display()
{
super.ssup=120;
ssup=420;
System.out.prin tln("iam super's mem"+ssup+" "+super.ssu p);
System.out.prin tln("i'll get executed for the Extended class");
return inh;
}
[/code]
vdmn.java:
[code=java]
package inherint;
class vdmn{
public static void main(String args[])
{
inhr ob1=new inhr(20,30,40);
inhr ob2=new inhr(ob1);
ob1.disp();
ob2.disp();
inher ob11=new inher(200,300,4 00,500);
ob11.disp();
ob11.display();
//ob1.display();
}
}[/code]
i am having this problem while i am implementing inheritance in a package named"inherint" which is a sub-directory of the directory "shashikayubbi" !!!
i've a super class inhr.java,a derived class inher.java !!!
well the code runs completely ok when i am executing it from the directory "shashikayu bbi" , but when i put these files in the sub-dir "inherint" there is a problem at the time of compliling the code and the compiler responds "class:inhr not found"
"Please don't tell me about configuring the classpath variable coz i've tried it!!!"
so here the codes
inhr.java:
[code=java]
package inherint;
class inhr
{
int ssup;
public int inht1;
public int inht2;
public int inht3;
inhr(){}
public inhr(inhr o)
{
inht1=o.inht1;
inht2=o.inht2;
inht3=o.inht3;
}
inhr(int i,int j,int k)
{
inht1=i;
inht2=j;
inht3=k;
}
void disp()
{
System.out.prin t("I am in Super class");
System.out.prin tln("var values"+inht1+" "+inht2+" "+inht3);
}
}
[/code]
inher.java:
[code=jave]
package inherint;
class inher extends inhr
{
int inh;
int ssup;
inher(int i,int j,int k,int l)
{
super(i,j,k);
inh=l;
}
int display()
{
super.ssup=120;
ssup=420;
System.out.prin tln("iam super's mem"+ssup+" "+super.ssu p);
System.out.prin tln("i'll get executed for the Extended class");
return inh;
}
[/code]
vdmn.java:
[code=java]
package inherint;
class vdmn{
public static void main(String args[])
{
inhr ob1=new inhr(20,30,40);
inhr ob2=new inhr(ob1);
ob1.disp();
ob2.disp();
inher ob11=new inher(200,300,4 00,500);
ob11.disp();
ob11.display();
//ob1.display();
}
}[/code]
Comment