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