Originally posted by Ganeshkumar cheekati:
can attributes in the subclass override the attributes in the super class?
can attributes inherited?
can you explain me with an example?
I think so, subclass can override the attribute of the superclass, here is a simple programme which could prove that line.
The answer of it is 3
and,
class Super
{
public int arr=34;
public void method()
{
}
}
class Sub extends Super
{
Sub()
{
System.out.println(arr);
}
public static void main(String[] args)
{
Sub e=new Sub();
}
}
The answer of this program is 34
[ October 24, 2008: Message edited by: Pawan Arora ]