About Question enthuware.ocpjp.i.v11.2.1362 :
Moderator: admin
-
- Posts: 3
- Joined: Fri Jul 10, 2020 7:30 pm
- Contact:
About Question enthuware.ocpjp.i.v11.2.1362 :
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
-
- Site Admin
- Posts: 10058
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.1362 :
> final static variable cannot be hidden by subclass.
Have you tried hiding a final static variable?
Have you tried hiding a final static variable?
If you like our products and services, please help us by posting your review here.
-
- Posts: 47
- Joined: Mon Apr 08, 2013 7:55 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.1362 :
Hi,
What do you mean by
What do you mean by
Do you mean code like the below is not possible?synchronized keyword can never be applied to a class.
Code: Select all
synchronized( myClass.class ){
//some code
}
-
- Site Admin
- Posts: 10058
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.1362 :
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).
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).
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 117 guests