[General]acces of members of subclass
- From: Daniel Moyne <daniel.moyne@xxxxxxx>
- Date: Sun, 27 Jul 2008 10:57:58 +0200
When you have this :
public class My_Class {
public method_1 {...}
public method_2 {...}
public int u;
public String v;
}
you can get access to members like this :
My_Class aa=new My_Class();
int k=aa.u;
String l=aa.v;
but in this case :
public class My_Class {
public method_1 {...}
public method_2 {...}
public int u;
public String v;
}
public class My_Other_Class extends My_Class{
public method_3 {}
public method_4 {}
public int w;
public String z;
}
How can I access public members w and z once I have done this :
My_Class aa=new My_Other_Class();
Apparently subclasses are designed for private members ?
Thanks
.
- Follow-Ups:
- Re: [General]acces of members of subclass
- From: Mark Space
- Re: [General]acces of members of subclass
- From: RedGrittyBrick
- Re: [General]acces of members of subclass
- Prev by Date: Re: [NetBeans]changing menuitems
- Next by Date: Rifle & Ammunition Retail Store - Sportsman, Wildlife and Outdoor Supply
- Previous by thread: adding a List of JTextField to the GUI
- Next by thread: Re: [General]acces of members of subclass
- Index(es):
Relevant Pages
|