|
-
September 28th, 1999, 06:11 AM
#1
Type Casting - II
Hi.....
I have a question & its answer but i am confuse about it.
If any one clear about thsi question explain me.
Question is
class class1{}
class class2 extends class1{}
class class3 extends class3{}
When is the following method valid?
public class1 castMe(class3 ref){
return (class1)ref;
}
A. Always
B. Never
C. If and only if ref references an class3 object
D. If and only if ref references an class2 object
Answer : A
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|