Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call parent class data

 
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
Marshal
Pie
Posts: 21514
84
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....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic