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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
buliasz
Posts: 1
Joined: Fri May 01, 2015 7:48 am
Contact:

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

Post 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"?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Yes, it is default and it means "package protected", which is what the statement says as well.
If you like our products and services, please help us by posting your review here.

bniky1
Posts: 4
Joined: Sun Jan 08, 2017 12:27 pm
Contact:

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

Post by bniky1 »

Shouldn't 'public void compute();' be assumed to be an abstract method? and so should "void compute();"?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post 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.

yulinxp
Posts: 12
Joined: Sat Dec 02, 2023 12:54 pm
Contact:

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

Post 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".

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Badem48
Posts: 26
Joined: Thu Aug 24, 2023 4:33 pm
Contact:

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

Post 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.

Badem48
Posts: 26
Joined: Thu Aug 24, 2023 4:33 pm
Contact:

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

Post by Badem48 »

Sorry now I noticed that it supposed to be FooI.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 61 guests