About Question enthuware.ocajp.i.v7.2.1272 :
Moderator: admin
About Question enthuware.ocajp.i.v7.2.1272 :
Seems like there's bug here:
"final Object[ ] objArr = { null } ;" should be right answer but answer key suggests otherwise.
"final Object[ ] objArr = { null } ;" should be right answer but answer key suggests otherwise.
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
The question asks for the ones that are NOT valid.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
Re: About Question enthuware.ocajp.i.v7.2.1272 :
the use of transient and volatile are not for OCA
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
Objective 2.1 is "Declare and initialize variables"
So you should at least be aware of what these keywords do while declaring variables.
HTH,
Paul.
So you should at least be aware of what these keywords do while declaring variables.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 7
- Joined: Sun Apr 07, 2013 9:45 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
native void format( ) ; seems to declare an abstract method, since the method body is missing, but there is also no abstract keyword. Is it legit in a class? If so, when and how?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
It is not an abstract method because there is no abstract keyword. It is a native method, that is why there is no method body. It means it is implemented by a native library and not in java code at that point.SirZed wrote:native void format( ) ; seems to declare an abstract method, since the method body is missing, but there is also no abstract keyword. Is it legit in a class? If so, when and how?
-Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 7
- Joined: Sun Apr 07, 2013 9:45 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
Okay, thanks!
-
- Posts: 37
- Joined: Thu Feb 13, 2014 12:58 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
Is the sequence of this option correct?
final transient static private double PI = 3.14159265358979323846
can we put private in 4th place?
are the access modifier, static and transient in same level?
Where can I find a document about declaring variable and method sequences?
final transient static private double PI = 3.14159265358979323846
can we put private in 4th place?
are the access modifier, static and transient in same level?
Where can I find a document about declaring variable and method sequences?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
Yes, it is valid. You can easily try it out
Please see this for all the details - http://docs.oracle.com/javase/specs/jls ... jls-3.html
Please see this for all the details - http://docs.oracle.com/javase/specs/jls ... jls-3.html
If you like our products and services, please help us by posting your review here.
-
- Posts: 37
- Joined: Thu Feb 13, 2014 12:58 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
the explanation mentioned:
Note: a class declaration can have only have final, abstract and public as
modifiers, unless it is a nested class, in which case, it can be declared private
or protected as well.
But we can have a class with no modifier (Default) too, Am I wrong?
Note: a class declaration can have only have final, abstract and public as
modifiers, unless it is a nested class, in which case, it can be declared private
or protected as well.
But we can have a class with no modifier (Default) too, Am I wrong?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
Yes, you can have no modifier as well. The explanation is talking about valid modifiers only. default is default. It is not a valid modifier.
If you like our products and services, please help us by posting your review here.
-
- Posts: 10
- Joined: Fri Mar 06, 2020 5:18 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
Technically, the option 'abstract void format( ) ;' is also wrong, since if this method is in a class, the class has to be abstract too...
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1272 :
The problem statement doesn't say it has to be a concrete class. An abstract class is a class!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Bing [Bot] and 53 guests