| Author |
Simple Question regarding Abstract class
|
jo sim
Ranch Hand
Joined: Apr 24, 2006
Posts: 37
|
|
Can you have a private variable in an abstract class? also Can you have a static variable in an abstract class? and why?
|
 |
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
|
|
Yes and Yes An Abstract class will be part of a final class and as such can do everything a final class can with the exception of being instanciated directly.
|
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
|
 |
jo sim
Ranch Hand
Joined: Apr 24, 2006
Posts: 37
|
|
|
can you instantiate an abstract class indirectly if not directly and if so how?
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
You can instantiate a concrete subclass of an abstract class.
|
 |
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
|
|
An abstract class will be instanciated as part of the object creation process of any final class that extends it. Give it a spin
|
 |
Jan Groth
Ranch Hand
Joined: Feb 03, 2004
Posts: 456
|
|
@jo pure curiosity - why don't you try yourself? don't get me wrong, it's good to post questions here, but in order to find out the answer to a "can i ..." question, trying out is perfectly okay. if it comes to the "why..." part, people will be happy to help... many greetings, jan
|
 |
jo sim
Ranch Hand
Joined: Apr 24, 2006
Posts: 37
|
|
Thanks for helping me out I wanted to know if there was a way to instantiate the abstract class but i guess there is no way. I wanted to know what is the meaning of explicit and implicit object casting? I cant seem to find resources on it can you provide me a link? thanks for your help.
|
 |
 |
|
|
subject: Simple Question regarding Abstract class
|
|
|