Created
May 16, 2016 05:26
-
-
Save ad-m/060ea4dca5cf22a9a14db9568997ff64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| /** | |
| * | |
| * @author adas | |
| */ | |
| final public class Employee extends Person { | |
| } |
This file contains hidden or 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
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| /** | |
| * | |
| * @author adas | |
| */ | |
| public class Person { | |
| private transient long createTime; | |
| public Person(){ | |
| createTime = System.currentTimeMillis(); | |
| } | |
| public long getCreateTime() { | |
| return createTime; | |
| } | |
| @Override | |
| public String toString() { | |
| return getClass() + "[createTime=" + createTime + ']'; | |
| } | |
| } |
This file contains hidden or 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
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| /** | |
| * | |
| * @author adas | |
| */ | |
| final public class Student extends Person { | |
| } |
This file contains hidden or 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
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| /** | |
| * | |
| * @author adas | |
| */ | |
| public class TS11 { | |
| public static void main(String[] args) { | |
| Employee e1 = new Employee(); | |
| Person p1 = new Person(); | |
| Student s1 = new Student(); | |
| System.out.println((Object) e1); | |
| System.out.println((Object) p1); | |
| System.out.println((Object) s1); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment