Hi,
i need your help regarding following program.
import java.util.HashMap;
class A {
public static void main(
String[] args) {
HashMap<String,Object) map= new HashMap<String,Object>;
map.put("mode","create");
if(map.get("mode").equals("create")) {
System.out.println("ok");//it is executing
}
String mode=map.get("get");//gives compilation error
}
}
here it is comparing Object with String and give 'true' but while assigning,
it gives compilation error why?
anybody help me.