Skip to content

Instantly share code, notes, and snippets.

@ad-m
Created May 16, 2016 05:26
Show Gist options
  • Select an option

  • Save ad-m/060ea4dca5cf22a9a14db9568997ff64 to your computer and use it in GitHub Desktop.

Select an option

Save ad-m/060ea4dca5cf22a9a14db9568997ff64 to your computer and use it in GitHub Desktop.
/*
* 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 {
}
/*
* 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 + ']';
}
}
/*
* 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 {
}
/*
* 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