objects Archive

Casting Objects in Java

Reference values like primitive value can be cast and mostly casted during assignment, passing as parameter or via explicit casting. Widening conversions are permited in primitive data types but narrowing conversion must be done explicitly.  In similar way, upcasting ( subtypes to its super type) is allowed  and downcasting (supertype to  subtype) can be done

Array of Objects in java

Array of Objects : In our previous article Arrays in java, we discussed array of primitive data types  as a very useful  and power ful tool. Java also allows you to declare array of objects which is more useful  and powerful (logically & cleanly) tool.