About Question enthuware.ocpjp.v7.2.1722 :

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

Moderator: admin

Post Reply
Sai Divya sree
Posts: 14
Joined: Mon Jun 20, 2016 11:16 pm
Contact:

About Question enthuware.ocpjp.v7.2.1722 :

Post by Sai Divya sree »

Hi,
Since interfaces variable are by default static and final.Can we assign a new value to the version variable in MediaReader class?

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

Re: About Question enthuware.ocpjp.v7.2.1722 :

Post by admin »

You cannot change a final variable. So no, it is not possible to change version variable of Classic interface.
But MediaReader is not doing that. It has its own version variable.

Sai Divya sree
Posts: 14
Joined: Mon Jun 20, 2016 11:16 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1722 :

Post by Sai Divya sree »

Got it.Thank you.

saurabh.agarwal560
Posts: 11
Joined: Thu May 28, 2020 9:53 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1722 :

Post by saurabh.agarwal560 »

Why not we can have option 2 (Classic).version as it will call the classic version. With option 3 (Classic.this).version should call the version of MediaReader class as we are using this which takes current class reference. Please clarify.

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

Re: About Question enthuware.ocpjp.v7.2.1722 :

Post by admin »

Option 2 is (Classic)version; There is no dot. version is an int variable. How can you cast it to anything??

(Classic).version; is syntactically incorrect code.

Post Reply

Who is online

Users browsing this forum: No registered users and 241 guests