Shouldn't it be "default" - which differs from "protected"?(Note that the absence of access control keyword in the method declaration in a class means package protected.)
About Question enthuware.ocajp.i.v7.2.1150 :
Moderator: admin
-
- Posts: 1
- Joined: Fri May 01, 2015 7:48 am
- Contact:
About Question enthuware.ocajp.i.v7.2.1150 :
You wrote in comment to first answer:
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1150 :
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.
-
- Posts: 4
- Joined: Sun Jan 08, 2017 12:27 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1150 :
Shouldn't 'public void compute();' be assumed to be an abstract method? and so should "void compute();"?
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1150 :
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.bniky1 wrote:Shouldn't 'public void compute();' be assumed to be an abstract method? and so should "void compute();"?
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 202
- Joined: Mon Apr 02, 2018 8:40 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1150 :
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.
-
- Posts: 12
- Joined: Sat Dec 02, 2023 12:54 pm
- Contact:
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1150 :
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.
-
- Posts: 26
- Joined: Thu Aug 24, 2023 4:33 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1150 :
Hi,
I want to mention a small type.
The Fool interface spelled FooI, with and uppercase "i" not lowercase "L", in the code.
I want to mention a small type.
The Fool interface spelled FooI, with and uppercase "i" not lowercase "L", in the code.
-
- Posts: 26
- Joined: Thu Aug 24, 2023 4:33 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1150 :
Sorry now I noticed that it supposed to be FooI.
Who is online
Users browsing this forum: No registered users and 36 guests