About Question enthuware.ocpjp.i.v11.2.1362 :

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

Moderator: admin

Post Reply
rowdyy
Posts: 3
Joined: Fri Jul 10, 2020 7:30 pm
Contact:

About Question enthuware.ocpjp.i.v11.2.1362 :

Post by rowdyy »

the question is vague. final static variable cannot be hidden by subclass. I agree incase of instance variable it can be hidden. so if we consider final static this option cannot be selected. please verify

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

Re: About Question enthuware.ocpjp.i.v11.2.1362 :

Post by admin »

> final static variable cannot be hidden by subclass.

Have you tried hiding a final static variable?

renatumb
Posts: 47
Joined: Mon Apr 08, 2013 7:55 pm
Contact:

Re: About Question enthuware.ocpjp.i.v11.2.1362 :

Post by renatumb »

Hi,

What do you mean by
synchronized keyword can never be applied to a class.
Do you mean code like the below is not possible?

Code: Select all

        synchronized( myClass.class ){
            //some code
        }

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

Re: About Question enthuware.ocpjp.i.v11.2.1362 :

Post by admin »

No. It means the following is not allowed:
synchronized class Test{
}

In your example, synchronized( myClass.class ), synchronized is not being applied to a class. It is being applied to an object (that object is of type Class.class).

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests