About Question enthuware.ocajp.i.v7.2.1035 :
Moderator: admin
-
- Posts: 78
- Joined: Sun Jun 30, 2013 10:04 pm
- Contact:
About Question enthuware.ocajp.i.v7.2.1035 :
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'.
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'.
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
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.
-
- Posts: 9
- Joined: Fri Jan 31, 2014 8:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
If a subclass doesn't exist, it can't be abstract.
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
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.boonnick wrote:If a subclass doesn't exist, it can't be abstract.
If you like our products and services, please help us by posting your review here.
-
- Posts: 9
- Joined: Fri Jan 31, 2014 8:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
Oh sorry. I mean the (non-existant) subclass can't be abstract.
-
- Posts: 9
- Joined: Fri Jan 31, 2014 8:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
I mean that
"subclass of a final class can be abstract." would be false.
?
seems to be a true statement. As I read it. Because subclasses of final classes do not exist."subclass of a final class cannot be abstract."
"subclass of a final class can be abstract." would be false.
?
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
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.
-
- Posts: 3
- Joined: Wed Aug 27, 2014 10:26 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
Same thoughts here.boonnick wrote:I mean thatseems to be a true statement. As I read it. Because subclasses of final classes do not exist."subclass of a final class cannot be abstract."
"subclass of a final class can be abstract." would be false.
?
-
- Posts: 30
- Joined: Tue Mar 24, 2015 2:59 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
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?
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?
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
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.
-
- Posts: 1
- Joined: Sun Apr 11, 2021 2:31 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
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.
Is this fully correct? Default variables of superclasses cannot be accessed by subclasses in different packages.
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1035 :
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!
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.
Who is online
Users browsing this forum: No registered users and 119 guests