Win a copy of Fixing your Scrum this week in the Agile forum!

Shamayla Bukhari

Greenhorn
+ Follow
since Jun 24, 2011
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 Shamayla Bukhari

Yes.
10 years ago
Maybe what you are looking for is instanceof.


10 years ago
I am not sure what you are trying to accomplish here.
The class A has a variable i and B is inherited from A. So, why are you re declaring i again in B and hiding the i in A.It sort of kills the whole purpose of inheritance doesn't it? B already has i just use it.
To answer your questions

My question is how would i call variable i of class A in class C and class D.


If in B you re declare i you cant. you just have access to the one in the immediate parent using super keyword.
If you don't re declare it you can access and use it in any method by just using i=25; without super keyword.
And as far as I know

Also super().super() works for constructors of the grandparent class; then why not for other methods and variables?


This should and does not work.



10 years ago
Why are you first converting it to an object array. Just Iterate over the double list and store it in the string array by calling toString() on the List Items.

10 years ago