Skip to content

Instantly share code, notes, and snippets.

@miio
Created June 20, 2011 18:16
Show Gist options
  • Save miio/1036195 to your computer and use it in GitHub Desktop.
Save miio/1036195 to your computer and use it in GitHub Desktop.
Night H-Na-Hiro
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:
// エッチ・ナ・ヒロ
// \夜のエッチ・ナ・ヒロ/
}
}
@maraigue
Copy link

@ayako119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment