String object comparision
Error(s), warning(s): source_file.java:22: warning: [rawtypes] found raw type: Map
Map obj = new HashMap();
^
missing type arguments for generic class Map<K,V>
where K,V are type-variables:
K extends Object declared in interface Map
V extends Object declared in interface Map
source_file.java:22: warning: [rawtypes] found raw type: HashMap
Map obj = new HashMap();
^
missing type arguments for generic class HashMap<K,V>
where K,V are type-variables:
K extends Object declared in class HashMap
V extends Object declared in class HashMap
source_file.java:23: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type Map
obj.put("abc", 1);
^
where K,V are type-variables:
K extends Object declared in interface Map
V extends Object declared in interface Map
source_file.java:24: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type Map
obj.put( 1, "abc");
^
where K,V are type-variables:
K extends Object declared in interface Map
V extends Object declared in interface Map
4 warnings
str, str2, st3abcabcabc
(str==str2)true
str.equals(str2)true
(str==str3)false
str.equals(str3)true
str.intern() == str3.intern() = true
str.intern() == str2.intern() = true
{1=abc, abc=1}
true
false
|
|