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


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock question" Watch "Mock question" New topic
Author

Mock question

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


why doesn't it print XYZ XYZ ?


My one regret in life is that I am not someone else.
- Woody Allen
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 792
Polymorphism does not apply to variable. That is why a.bankName is "ABC" instead of "XYZ".
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Thanks
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
A good thread about the subject at instance variables - polymorphism(overriding).

Regards,
Dan

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
James X Peterson
Whizlabs Java Support
Ranch Hand

Joined: Feb 26, 2013
Posts: 158
Good question meeta gaur
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock question