If d is Double, then compiler definitely knows it is not a Date. so it will give a compiling error;
String s = "ddd";
System.out.println(""+ s instanceof String);
Double d = 1d;
System.out.println(d instanceof java.util.Date);
No comments:
Post a Comment