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

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

Moderator: admin

Post Reply
ewebxml
Posts: 78
Joined: Sun Jun 30, 2013 10:04 pm
Contact:

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

Post by ewebxml »

I answered this question correctly.
The very last sentence in the explanation is incorrect.

For the explanation:
"A class with all the members declared private can still be declared public or
a class having all public members may be declared private."
----
The access modifier 'private' cannot be used for a class.
Only
1) public,
2) abstract, and
3) final
are legal modifiers for the reference type 'class'.

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

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

Post by admin »

It can be, if the class is inside another class.
If you like our products and services, please help us by posting your review here.

boonnick
Posts: 9
Joined: Fri Jan 31, 2014 8:26 pm
Contact:

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

Post by boonnick »

If a subclass doesn't exist, it can't be abstract.

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

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

Post by admin »

boonnick wrote:If a subclass doesn't exist, it can't be abstract.
Not sure what you mean. A parent class has no knowledge of its subclasses. It can be abstract irrespective of whether a subclass exists or not.
If you like our products and services, please help us by posting your review here.

boonnick
Posts: 9
Joined: Fri Jan 31, 2014 8:26 pm
Contact:

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

Post by boonnick »

Oh sorry. I mean the (non-existant) subclass can't be abstract.

boonnick
Posts: 9
Joined: Fri Jan 31, 2014 8:26 pm
Contact:

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

Post by boonnick »

I mean that
"subclass of a final class cannot be abstract."
seems to be a true statement. As I read it. Because subclasses of final classes do not exist.

"subclass of a final class can be abstract." would be false.

?

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

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

Post by admin »

Depends on how you look at it. The statement is false because there cannot be a subclass of a final class. But the statement, "subclass of a final class cannot be abstract" implies that there can be a subclass of a final class.
If you like our products and services, please help us by posting your review here.

fabbbb
Posts: 3
Joined: Wed Aug 27, 2014 10:26 am
Contact:

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

Post by fabbbb »

boonnick wrote:I mean that
"subclass of a final class cannot be abstract."
seems to be a true statement. As I read it. Because subclasses of final classes do not exist.

"subclass of a final class can be abstract." would be false.

?
Same thoughts here.

alkour
Posts: 30
Joined: Tue Mar 24, 2015 2:59 pm
Contact:

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

Post by alkour »

It look like slight contradiction between explanations and correct answers.

The explanation states: "A subclass can be declared abstract REGARDLESS of whether the superclass was declared abstract".

Meanwhile, the answer "subclass of abstract class cannot be declared abstract" is marked as false statement.

What is correct?

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

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

Post by admin »

There is no contradiction. The option is false because subclass of an abstract class can be declare abstract.
If you like our products and services, please help us by posting your review here.

enesoral
Posts: 1
Joined: Sun Apr 11, 2021 2:31 pm
Contact:

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

Post by enesoral »

The extends clause is used to specify that a class extends another class and thereby inherits all non-private instance members of that class.

Is this fully correct? Default variables of superclasses cannot be accessed by subclasses in different packages.

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

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

Post by admin »

It is a general statement about "extends" and its purpose. It is not meant to provide complete detail on the rules.
Even so, the explanation has now been enhanced to make it clear.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests