java typeof

Solutions on MaxInterview for java typeof by the best coders in the world

showing results for - "java typeof"
Paolo
25 Jun 2016
1Object obj = null;
2obj = new ArrayList<String>();
3System.out.println(obj.getClass());
4
5obj = "dummy";
6System.out.println(obj.getClass());
7
8obj = 4;
9System.out.println(obj.getClass());