In Inheritance if we are implementing Multi level inheritance
and all class having same name of variable and now i want to
access each class variable and how it is possible?
Answers were Sorted based on User's Feedback
Answer / megha
IF ClassC extends ClassB and ClassB extends ClassA
All Classes having "public int a " with different values,
then
ClassA objA = new ClassA();
ClassB objAB = new ClassB();
ClassC objAC = new ClassC();
System.out.println(objA.a);
System.out.println(objAB.a);
System.out.println(objAC.a);
will show each class variable individually
****************************O R *******************
make a method to return superclass variable using "super.a"
Is This Answer Correct ? | 4 Yes | 0 No |
when a servlet sends request for first time it uses the follwing methods a)init b)doget() c)dopost() d)service
what is the difference between equals method and ==
17 Answers IBM, Professional Access, TCS,
What is Yield() method when we r using this ? tell exactly
What do u mean by method and also contructer in java ?
What is boolean flag in java?
when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???
what is java
What is the use of inner class?
What is int argc char * argv?
Who developed JScript language?
What is the difference between abstract classes and interfaces?
What is difference between equal and == in java?