Created
August 14, 2016 13:01
-
-
Save gihara/d38fccb8fcb51e14ece99ce3492d3af2 to your computer and use it in GitHub Desktop.
super_this
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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