Skip to content

Instantly share code, notes, and snippets.

@takanakahiko
Created February 1, 2015 14:23
Show Gist options
  • Select an option

  • Save takanakahiko/b67d64897956e055caf5 to your computer and use it in GitHub Desktop.

Select an option

Save takanakahiko/b67d64897956e055caf5 to your computer and use it in GitHub Desktop.
テスト
abstract class SushiYa{
static void vote(){
System.out.println("�ӉZ���i");
}
}
class Daisou extends SushiYa{
static void vote(){
System.out.println("���m���i");
}
}
class California extends SushiYa{
static void vote(){
System.out.println("�U�E�J���t�H���j�A���[��");
}
}
public class Hogehoge2{
public static void main(String[] args){
SushiYa[] mise ={new Daisou(),new Daisou(),new California(),new California(),new California()};
((SushiYa)mise[0]).vote();
mise[1].vote();
mise[2].vote();
((California)mise[3]).vote();
mise[4].vote();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment