File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Explanation for the statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Explanation for the statements" Watch "Explanation for the statements" New topic

Explanation for the statements

Sathya Shanmugam
Ranch Hand

Joined: Mar 02, 2007
Posts: 45
Hi friends

Pls give some detail explanation with example for the following statements from KB book

" A Single object can be referred to by reference variable of many different types - as long as they are the same type or a super type of the object"
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Consider this example.

There is only one D object created, but it can be referred to as an A, a B, a C, or a D.
Sathya Shanmugam
Ranch Hand

Joined: Mar 02, 2007
Posts: 45
thanks Keith, now I understood the statement clearly with your example.
I agree. Here's the link:
subject: Explanation for the statements
Similar Threads
Question about Sequence Diagram
Integer inheritence problem
Swimming up Stream
Error in Inquisition