Created
July 9, 2018 14:06
-
-
Save dhirabayashi/4d68a3dc13486b8958137b13c7a4092d 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
public class VarSample { | |
public static void main(String[] args) { | |
var str = "test"; | |
System.out.println(str.toUpperCase()); | |
var o = new Object() { | |
public int sum(int x, int y) { | |
return x + y; | |
} | |
}; | |
System.out.println(o.sum(5, 7)); | |
System.out.println(o.getClass().getName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment