Skip to content

Instantly share code, notes, and snippets.

@skRyo
Created July 25, 2012 11:56
Show Gist options
  • Save skRyo/3175775 to your computer and use it in GitHub Desktop.
Save skRyo/3175775 to your computer and use it in GitHub Desktop.
教えてエライ人
interface Debugprintable {
void debugprint();
}
public class mynumber implements Debugprintable{
private int a;
public mynumber(int a) {
this.a = a;
}
public void debugprint() {
System.out.println(a);
}
public static void main(String[] args) {
mynumber a = new mynumber(100);
a.debugprint();
Debugprintable b = new mynumber(200);
b.debugprint();
// これの違い何ですか?
// インターフェース型?
// どっちが正解なの?
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment