Created
November 11, 2013 16:46
-
-
Save hydai/7416285 to your computer and use it in GitHub Desktop.
modify the code so that it can compile correctly.
This file contains 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
class Test { | |
public static void main (String[] args) { | |
Test t = new Test(); | |
/* | |
System.out.println(t.xmethod(7)); | |
// Error: t.xmethod is void type, so we cannot put it in println | |
*/ | |
t.xmethod(7); | |
} | |
public void xmethod(int t) { | |
System.out.println("int"); | |
} | |
public void xmethod(long t) { | |
System.out.println("long"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment