Created
April 14, 2020 02:10
-
-
Save SanthoshBabuMR/6a3322bd8c3c0931e69dd27a01cdf52d to your computer and use it in GitHub Desktop.
Java - get data type
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 Main { | |
public static void main(String[] args) { | |
String name = "foo"; | |
System.out.println(name); // foo | |
System.out.println(name.getClass()); // class java.lang.String | |
System.out.println(name.getClass().getName()); // java.lang.String | |
System.out.println(name.getClass().getSimpleName()); // String | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment