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
- 
				piotrkmiotczyk
 - Posts: 27
 - Joined: Mon Sep 22, 2014 1:30 pm
 - Contact:
 
- 
				admin
 - Site Admin
 - Posts: 10443
 - 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.
			
			
									
									
						- 
				Aditya553
 - 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?
			
			
									
									
						- 
				admin
 - Site Admin
 - Posts: 10443
 - 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?
			
			
									
									
						- 
				Aditya553
 - 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 44 guests