Ok, here’s the issue!
I have a class GetStuff
public class GetStuff {
public GetStuff(String data) {
// stuff
}
}
In this class I have a method getMyStuff() which calls a second method:
getAllMyStuff();
Now, I want to extend my class so I’ll make a:
public class GetSecondStuff extends GetStuff {
public GetSecondStuff(String data, int newData) {
super(data);
}
}
in this 2nd class I will override my getAllMyStuffMethod, but inside this method I’ll need to use the newData parameter from the constructor:
private String getAllMyStuffMethod() {
if (newData==0) // do something
}
How can I use here newData ? 🙁
OUTPUT :
GetStuff
GetSecondStuff
new data : 1