473,385 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Using inheritance in the package!!

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 "shashikayubbi" , 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:
Expand|Select|Wrap|Line Numbers
  1. package inherint;
  2. class inhr
  3. {
  4.   int ssup;
  5.  public int inht1;
  6.   public int inht2;
  7.   public int inht3;
  8.  
  9.  
  10.  inhr(){}
  11.  
  12. public inhr(inhr o)
  13. {
  14.   inht1=o.inht1;
  15.   inht2=o.inht2;
  16.   inht3=o.inht3;
  17. }
  18.  
  19.  inhr(int i,int j,int k)
  20.   {
  21.    inht1=i;
  22.   inht2=j;
  23.   inht3=k;
  24. }
  25. void disp()
  26. {
  27.  System.out.print("I am in Super class"); 
  28.  System.out.println("var values"+inht1+" "+inht2+" "+inht3);
  29. }
  30.       }
  31.  
inher.java:
Expand|Select|Wrap|Line Numbers
  1. package inherint;
  2.  class inher extends inhr
  3. {
  4.   int inh;
  5.    int ssup;
  6.  
  7. inher(int i,int j,int k,int l)
  8. {
  9.   super(i,j,k);
  10.   inh=l;
  11.                    }
  12.  int display()
  13. {
  14.  
  15.    super.ssup=120;
  16.     ssup=420;
  17.   System.out.println("iam super's mem"+ssup+"   "+super.ssup);
  18.   System.out.println("i'll get executed for the Extended class");
  19.  
  20.   return inh;
  21.                }
  22.  
vdmn.java:
Expand|Select|Wrap|Line Numbers
  1. package inherint;
  2. class vdmn{
  3. public static void main(String args[])
  4. {
  5.     inhr ob1=new inhr(20,30,40);
  6.     inhr ob2=new inhr(ob1);
  7.  
  8.  
  9.   ob1.disp();
  10.   ob2.disp();
  11.    inher ob11=new inher(200,300,400,500);
  12.    ob11.disp();
  13.    ob11.display();
  14.    //ob1.display();
  15.  
  16. }
  17.         }
Sep 24 '08 #1
2 1292
Nepomuk
3,112 Expert 2GB
"Please don't tell me about configuring the classpath variable coz i've tried it!!!"
In that case, we'll probably not be able to help you, because it will be a classpath problem. But if you tell us, how you configured the classpath, we'll probably be able to figure out, what's not working.

Oh, and please use [CODE] ... [/code] tags - they really help. Just look, I've added them to your post and it's much easier to read now.

Greetings,
Nepomuk (Moderator)
Sep 24 '08 #2
In that case, we'll probably not be able to help you, because it will be a classpath problem. But if you tell us, how you configured the classpath, we'll probably be able to figure out, what's not working.

Oh, and please use [CODE] ... [/code] tags - they really help. Just look, I've added them to your post and it's much easier to read now.

Greetings,
Nepomuk (Moderator)
ya
mayb u r right
thanks for the reply


well here is how i've done that
Variablename: CLASSPATH

VAriableValue: C:\shashikayubbi\inherint\

or .;C:\shashikayubbi\inherint\
or .C:\shashikayubbi\inherint\


which one is the correct way http://bytes.com/forum/images/icons/icon5.gif

Remember "shashikayubbi" is ma current working directory and the "inherint" is it's sub-dir that i am using as the package directory!!!
Sep 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Gil | last post by:
Hi, I have 2 classes in a package. One class inherits from the other. I had no problems compiling the classes when the classes weren't in a package, but as soon as I put the classes in a...
2
by: | last post by:
Sorry, I mixed up the code- reposting with correct example now :) I'm trying to better understand the use of inheritance vs. the implementation of a handler. I wanted to ask this question to the...
1
by: NotEnough | last post by:
I have a program assigment due next week. I have a a simple c++ grade average program below. How do I turn it into an inheritance. Where Grade is the base class. And Quiztest - Project - LabTest -...
2
by: elbomberotorero | last post by:
Hi everyone, I have several aspx files which inherit from a common file called Menu. In this file, I overwrite the Page_Load method and I put inside it the LoadControl method to load an user...
0
by: emiliano | last post by:
Hey guys, i was just googling some information about how to use the ClientForm package with a page which requires HTTP basic authentication and i got here :P ... So here is the problem, lets see if...
4
by: vivekian | last post by:
Hi, Have this following hierarchy which am implementing for a networking program. The base class 'ASocket' is the base class from which 'AListener' and 'ATalker' inherit . None of the functions...
1
by: kunju | last post by:
Hi, I want to import data to a parent and child table from two different csv files. Csv file for the parent table have got the primary key(integer) field and child have the forien key . My problem...
0
by: shark | last post by:
Hi All, i am getting the error as posted below while executing Transfer logins using Dts package - sql server 2000 standard edition Can any body help? Microsoft Windows (C) Copyright...
2
by: kalpanareddy16 | last post by:
1 declare 2x1 number; 3 begin 4x1 :=5; 5 declare 6x2 number ; 7 begin 8x2 :=6; 9 x1:=x2 ; 10 end; 11 x2 := X1 ; 12 * end; 13 / x2 :=X1; *error at line 11:ORA-06550 :line 11,column...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.