About Question enthuware.ocpjp.ii.v11.2.3511 :

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

Moderator: admin

Post Reply
sir_Anduin@yahoo.de
Posts: 62
Joined: Fri Aug 07, 2015 2:16 pm
Contact:

About Question enthuware.ocpjp.ii.v11.2.3511 :

Post by sir_Anduin@yahoo.de »

interface methods can never be declared final.
small correction:

private methods can be final

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

Re: About Question enthuware.ocpjp.ii.v11.2.3511 :

Post by admin »

Not really. The explanation is clearly talking about interface. Did you try it out?

sir_Anduin@yahoo.de
Posts: 62
Joined: Fri Aug 07, 2015 2:16 pm
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3511 :

Post by sir_Anduin@yahoo.de »

Yes. And it works.

I mean private methods on interfaces can be final

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

Re: About Question enthuware.ocpjp.ii.v11.2.3511 :

Post by admin »

What code did you try? The following doesn't compile:
interface X{
private final void m(){ }
}

sir_Anduin@yahoo.de
Posts: 62
Joined: Fri Aug 07, 2015 2:16 pm
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3511 :

Post by sir_Anduin@yahoo.de »

I appologize, after running it again I saw that it is not compiling. Must have forgotten to save or something like that.
You might delete this thread

Post Reply

Who is online

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