Page 1 of 1

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

Posted: Fri May 01, 2015 7:52 am
by buliasz
You wrote in comment to first answer:
(Note that the absence of access control keyword in the method declaration in a class means package protected.)
Shouldn't it be "default" - which differs from "protected"?

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

Posted: Fri May 01, 2015 8:45 pm
by admin
Yes, it is default and it means "package protected", which is what the statement says as well.

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

Posted: Thu Feb 23, 2017 8:18 pm
by bniky1
Shouldn't 'public void compute();' be assumed to be an abstract method? and so should "void compute();"?

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

Posted: Thu Feb 23, 2017 11:41 pm
by admin
bniky1 wrote:Shouldn't 'public void compute();' be assumed to be an abstract method? and so should "void compute();"?
Yes, all non-static (and in Java 8, non-default) methods of an interface are abstract even if they are not explicitly declared to be so.

HTH,
Paul.

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

Posted: Sat May 19, 2018 3:19 am
by flex567
I don't understand why the book OCA Oracle Certified Associate - Jeanne Boyarsky doesn't contain this sentence:
An interface can have a static method but the method must have a body in that case.

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

Posted: Wed Dec 20, 2023 1:14 pm
by yulinxp
admin wrote:
Fri May 01, 2015 8:45 pm
Yes, it is default and it means "package protected", which is what the statement says as well.
So "package protected" means default, which is different than the normal "protected" modifier. I have never heard about "package protected".

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

Posted: Wed Dec 20, 2023 10:42 pm
by admin
There is no modifier named "package protected". This phrase is used just to explain the default accessibility. The default accessibility (which you get when you don't apply any modifier) is different from "protected" accessibility.

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

Posted: Mon Jan 01, 2024 10:48 am
by Badem48
Hi,

I want to mention a small type.
The Fool interface spelled FooI, with and uppercase "i" not lowercase "L", in the code.

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

Posted: Mon Jan 01, 2024 10:49 am
by Badem48
Sorry now I noticed that it supposed to be FooI.

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

Posted: Wed Jun 04, 2025 9:22 am
by witek_m
what about the answer:

Code: Select all

sealed class MyClass {   }
with the explanation: "Here, no such subclass of MyClass exists and so this definition will not compile."
But the question is about the declaration, not the definition, so it doesn’t really meet the conditions stated in the question.

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

Posted: Wed Jun 04, 2025 10:15 am
by admin
You are right. The statement "(Assume that there is no other member in the interface.)" has now been added in this option.
thank you for your feedback!