Skip to content

Instantly share code, notes, and snippets.

@gihara
Created August 14, 2016 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gihara/d38fccb8fcb51e14ece99ce3492d3af2 to your computer and use it in GitHub Desktop.
Save gihara/d38fccb8fcb51e14ece99ce3492d3af2 to your computer and use it in GitHub Desktop.
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