Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

How can I override the “calculate()” method in subclasses?

Asked by Charles Parr Jan 9, 2024 690 views 1 answer
Share

About this question

While engaging with the Java-based project I created a superclass by using the method which is known as “calculate()” which can perform internal calculations. Now I have extended this particular superclass to various subclasses. Explain to me if it is possible to override the “calculate()” method in the subclasses or not, if not is there any alternative approach available? 

Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.