Hi Folks,
Since abstract classes cannot be instantiated in
java, I understand that the following code will not work:
However I noticed that the follwing code works fine, as in there is no compilation error:
I don't understand why. When we use the 'new' operator, are we not creating a new instance of the class, which in this case is not possible since 'DateFormat' is an abstract class? Yet the 2nd line of code works. Will be great if somone is able to explain. Thanks in advance.