[ java ] in KIDS 글 쓴 이(By): iknowyou (Coffeeman) 날 짜 (Date): 1997년11월13일(목) 20시27분20초 ROK 제 목(Title): [polymorphism in JAVA]Main.java public class Main { public static void main(String Argv[] ){ Student students[] = { new Student(2,"Lee"), new Student(5,"Kim"), new Student(3,"Park"), new Student(7,"Choi"), new Student(6,"Jin"), new Student(10,"Money"), }; for(int i = 0; i < students.length;i++) System.out.println( students[i].id + students[i].name +"\t"); System.out.println("\n"); Sort.InsertionSort( students ); - for(int i = 0; i < students.length;i++) System.out.println( students[i].id + students[i].name +"\t"); } } class Life extends Object implements Dynamic { Life(Life father, Life mother){} responseToThis(Life this){} responseToOthers(Life others){} } |