When you assign a variable of parent class type to an object of subclass,
the implicit casting occurs.
Example:
java.util.Date parentDate = null;
parentDate = new java.sql.Date(Calendar.getInstance().getTime().getTime());
The above code is valid. Here we no need to do explicit casting
.
Regards,
Vishnu


-----Original Message-----
From: Emmanuel Eze
To: JDJList
Sent: 5/7/02 11:08 AM
Subject: [jdjlist] casting
This cast thing is beginning to get me confused. if I cannot cast a
java.util.Date to a java.sql.Date since the util.Date is the ancestor
class,
can I cast a java.sql.Date to java.util.Date.� I really wish to
understand
the nitty gritty of casting.
�

                 


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to