Which one of these is a proper definition of a class TestClass that cannot be sub-classed? (choose one)
final class TestClass { }
abstract class TestClass { }
native class TestClass { }
static class TestClass { }
private class TestClass { }
Answer is 1.
My question is: does 'subclassing' a class mean exactly the same as extending it?
Thanks.
About Question com.enthuware.ets.scjp.v6.2.171 :
Moderator: admin
-
- Posts: 27
- Joined: Mon Sep 22, 2014 1:30 pm
- Contact:
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.171 :
Yes, that is correct. Subclassing is another term that means the same as extending.
If you like our products and services, please help us by posting your review here.
-
- Posts: 15
- Joined: Sun Aug 06, 2017 2:37 am
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.171 :
what about private class?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.171 :
What happened when you tried it out?
If you like our products and services, please help us by posting your review here.
-
- Posts: 15
- Joined: Sun Aug 06, 2017 2:37 am
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.171 :
ok so the outer class cannot have private modifieradmin wrote:What happened when you tried it out?
Who is online
Users browsing this forum: No registered users and 22 guests