Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
super_this
public class Main {
public static void main(String args[]) {
Track track = new Track();
track.name();
}
}
class Car {
int loadCapacitiy=100;
}
class Track extends Car{
public void name() {
super.loadCapacitiy = 500;
System.out.println(super.loadCapacitiy);
System.out.println(this.loadCapacitiy);
this.loadCapacitiy = 1500;
System.out.println(super.loadCapacitiy);
System.out.println(this.loadCapacitiy);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.