Created
July 25, 2012 11:56
-
-
Save skRyo/3175775 to your computer and use it in GitHub Desktop.
教えてエライ人
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
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