Created
June 20, 2011 18:30
-
-
Save miio/1036227 to your computer and use it in GitHub Desktop.
NightPeoples
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
public class NightPeoples { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
class HHiro{ | |
protected String name="エッチ・ナ・ヒロ"; | |
@Override | |
public String toString(){ | |
return name; | |
} | |
} | |
class Miio{ | |
protected String name="エッチ・ナ・ミイオ"; | |
@Override | |
public String toString(){ | |
return name; | |
} | |
} | |
class NightPeople{ | |
protected String name=""; | |
@Override | |
public String toString(){ | |
return "\夜の"+name+"/"; | |
} | |
} | |
class NightHHiro extends NightPeople{ | |
public NightHHiro(){ | |
name = new HHiro().toString(); | |
} | |
} | |
class NightMiio extends NightPeople{ | |
public NightMiio(){ | |
name = new Miio().toString(); | |
} | |
} | |
List<NightPeople> hPeoples = new ArrayList<NightPeople>(); | |
hPeoples.add(new NightMiio()); | |
hPeoples.add(new NightHHiro()); | |
for(NightPeople h: hPeoples){ | |
System.out.println(h); | |
} | |
//Result: | |
// \夜のエッチ・ナ・ミイオ/ | |
// \夜のエッチ・ナ・ヒロ/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment