Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

geethal rodrigo

Greenhorn
+ Follow
since Jul 18, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by geethal rodrigo

Thanks very much. I got it.
Thing is when call sup.a, f() method in the sub class will work . I think you know variable hiding when took a super class reference and created a sub class object. Since sub class 'b' is hidden by the super class variable super class cannot see wthat the value is in the sub class.Only it know it'sinteger type. So it give the default value of integer. Just put an integer value(such as 'return 5;') to returning value for the sub class and surely it will print that given value.
[ July 19, 2007: Message edited by: geethal rodrigo ]
when locan inner class object is created that object can only access within the method because of the variable scope.IS THERE ANY WAY TO ACCESS THE LOCAL INNER CLASS FROM THE MAIN METHOD BY ONLY USING INNER CLASS REFERENCE .I TRYIED EVERYTHING .PLEASE HELP.

class Outer{
void m(){
class Inner{
void m2(){
System.out.println("It works");
}
}
Inner i1=new Inner();
i1.m2();

}
}
class Main extends Outer{
public static void main(String arg[]){
Outer a2=new Outer();
a2.m();
xxxxxxx.m2();
}
}
Like this I want to access m2().