Created
December 16, 2011 02:14
-
-
Save takuma7/1484112 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
import Mondai14_2.java; | |
abstract class Student{ | |
void study(int hour){ | |
System.out.println("studied at home for " + hour + "hour(s)."); | |
} | |
abstract void work(int hour); | |
} | |
class Pattern1 extends Student{ | |
void work(int hour){ | |
Convenience cv = new Convenience(); | |
cv.calc(hour); | |
cv.hyouji(); | |
} | |
} | |
class Pattern2 extends Student{ | |
void work(int hour){ | |
System.out.println("gave a help for " + hour + " hour(s)."); | |
} | |
} | |
class Mondai14_3{ | |
public static void main(String[] args){ | |
Pattern1 tomoko = new Pattern1(); | |
Pattern1 tatsuhiro = new Pattern1(); | |
Pattern2 nobuyasu = new Pattern2(); | |
tomoko.work(3); | |
tomoko.study(3); | |
tatsuhiro.work(5); | |
tatsuhiro.study(1); | |
nobuyasu.work(2); | |
nobuyasu.study(5); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment