Monday, 23 May 2016

instanceof determine if a subtypes is its super-type.

'instanceof' is used to determine if an object is a sub-type of a super-class.

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:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...