473,815 Members | 3,002 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using inheritance in the package!!

2 New Member
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:
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 1315
Nepomuk
3,112 Recognized Expert Specialist
"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
yulam4u
2 New Member
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:\shashikayubb i\inherint\

or .;C:\shashikayu bbi\inherint\
or .C:\shashikayub bi\inherint\


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

Remember "shashikayu bbi" 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
3540
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 package and appropriate directories, I get the error : cannot resolve symbol symbol : class Base
2
5581
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 newsgroup. Each aspx page is a class which Inherits System.Web.UI.Page. Then, each page has it's own implementation of Private Sub Page_Load and Private Sub Page_Init to handle the Handles MyBase.Load and Handles MyBase.Init events...
1
1833
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 - TestGrade are four devired class. /*------------------------------------------------------------------------------- *File Name: ReadTest.cpp *Abstract: Implement a class to process a list of grades *Student: *Date:
2
4272
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 control to the daughters without having these any code line referred to that control (@Register control, ...).
0
2030
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 anyone here can help me please solving this issue First i open the protected page using the FancyURLopener which support the HTTP basic authentication and pass this object to the ParseResponse function so it parses the corresponding forms :P ...
4
1477
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 in the derived classes would override functions from the base class. The derived classes would extend the base class. A couple of doubts : 1. Should the functions in the base class be declared virtual ?
1
1891
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 is that the last primary key value in the parent table may not match with the new ones . So i need to create ID's on import . IS there any way to relate these two tables in this manner using dts package. Thanks Anuja
0
2847
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 1985-2003 Microsoft Corp.
2
1906
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 1:PLS-00201: identifier 'X2' must be declared ORA-06550:line 11,column1: PL/SQL:statement ignored while executing the above nested block, getting the error as"identifier 'X2' must be declared".without declaring the variables inside the block how can u use...
0
9735
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10408
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7687
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5710
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3886
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.