question on objects

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
sulakshana
Posts: 14
Joined: Thu Dec 22, 2016 8:55 pm
Contact:

question on objects

Post by sulakshana »

If a question asks new parkRanger().notenewoffspring(_______)
What type of answers will match the blank in above......is it subclass or superclass or how to judge a question like this..

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: question on objects

Post by admin »

You can always pass a subclass object where the parameter type is a super type. You will need to go through a good book to understand the topic of polymorphism to answer such questions.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests