Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Wed Jan 09, 2013 10:55 am
by ETS User
Seems like there's bug here:

"final Object[ ] objArr = { null } ;" should be right answer but answer key suggests otherwise.

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Wed Jan 09, 2013 11:37 am
by admin
The question asks for the ones that are NOT valid.

HTH,
Paul.

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Sat Feb 02, 2013 10:40 am
by jacob
the use of transient and volatile are not for OCA

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Sat Feb 02, 2013 11:42 am
by admin
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.

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Fri Apr 26, 2013 2:57 pm
by SirZed
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?

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Fri Apr 26, 2013 5:39 pm
by admin
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?
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.

-Paul.

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Sat Apr 27, 2013 2:40 am
by SirZed
Okay, thanks!

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Mon Mar 03, 2014 10:50 pm
by fasty23
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?

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Mon Mar 03, 2014 10:55 pm
by admin
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

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Sun Mar 30, 2014 11:11 pm
by fasty23
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?

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Mon Mar 31, 2014 12:21 am
by admin
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.

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Wed Apr 22, 2020 3:20 am
by evaevaeva
Technically, the option 'abstract void format( ) ;' is also wrong, since if this method is in a class, the class has to be abstract too...

Re: About Question enthuware.ocajp.i.v7.2.1272 :

Posted: Wed Apr 22, 2020 3:28 am
by admin
The problem statement doesn't say it has to be a concrete class. An abstract class is a class!