Created
September 12, 2019 11:29
-
-
Save soheil-ghahremani/b060154b21ebd0afe654ebac668ac6e9 to your computer and use it in GitHub Desktop.
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
package ir.soheil_gh; | |
import java.util.HashMap; | |
public class LocalVariableTypeInferenceExample { | |
public static void main(String[] args) { | |
var test = "soheil"; | |
System.out.println(test.getClass().getCanonicalName()); | |
var test2 = 2*2; // test2 is int | |
System.out.println(test2); | |
var test3 = new HashMap<String, String>(); | |
System.out.println(test3.getClass().getCanonicalName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
java.lang.String
4
java.util.HashMap