Ask anything regarding computer / mobile /os. · Author has 100 answers and 549K answer views · 6y ·
Instantiation means you creating an object of that class.
There are some cases where you don’t want that your class’ instance will be created.
Now, you may have doubt that Why do I don’t want to create an object of that class?
So here are some reasons:
- A class contains only static methods or it is final. i.e. Math class in Java
- A class contains an abstract method(s) which means implementation of the method is not done. Now if you don’t have any implementation(logic) is done then there is no meaning of using that method. So If you create an object and then call that method. It is useless. That’s why it is not possible to instantiate an abstract class.
4.3K views ·
View upvotes
· 1 of 4 answers
Something went wrong. Wait a moment and try again.