• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to call parent class data  RSS feed

 
Inder Kumar Rathore
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here i have a code...


class A
{
int i=90;
}

class B extends A
{
int i=100;
}


class C extends B
{
int i=200;
void foo()
{
System.out.println(this.i);// C
System.out.println(super.i);// b
System.out.println(i);// now how i call i of A
}
}
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try...



Henry
 
Inder Kumar Rathore
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks....
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!