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 Mock question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock question" Watch "Mock question" New topic

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: 1122
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

Dan Drillich
Ranch Hand

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


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:
subject: Mock question
jQuery in Action, 3rd edition