Page 1 of 1

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

Posted: Sun Jul 26, 2020 7:44 pm
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

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

Posted: Sun Jul 26, 2020 9:27 pm
by admin
> final static variable cannot be hidden by subclass.

Have you tried hiding a final static variable?

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

Posted: Mon Mar 06, 2023 10:59 pm
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
        }

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

Posted: Mon Mar 06, 2023 11:46 pm
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).