Page 1 of 1

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

Posted: Fri Jul 05, 2013 6:58 am
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'.

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

Posted: Fri Jul 05, 2013 8:25 am
by admin
It can be, if the class is inside another class.

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

Posted: Sun Feb 02, 2014 1:21 pm
by boonnick
If a subclass doesn't exist, it can't be abstract.

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

Posted: Sun Feb 02, 2014 8:59 pm
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.

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

Posted: Mon Feb 10, 2014 5:55 pm
by boonnick
Oh sorry. I mean the (non-existant) subclass can't be abstract.

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

Posted: Mon Feb 10, 2014 6:50 pm
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.

?

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

Posted: Tue Feb 11, 2014 2:19 am
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.

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

Posted: Sun Aug 31, 2014 6:16 am
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.

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

Posted: Thu Mar 26, 2015 3:43 am
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?

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

Posted: Thu Mar 26, 2015 6:18 am
by admin
There is no contradiction. The option is false because subclass of an abstract class can be declare abstract.

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

Posted: Sun Apr 11, 2021 3:08 pm
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.

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

Posted: Sun Apr 11, 2021 10:44 pm
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!