Inheritance Method Overriding

Posted on 2004-10-22
Last Modified: 2010-03-31
if I have a method in a parent class like:

public void checkMonthlyFee()
     // method operations here

and I want to override this method with different operations in a child class, would I just rewrite that method in the child class as:

public void checkMonthlyFee()
     // NEW method operations here
Question by:smkJackstraw
    LVL 8

    Accepted Solution

    yes. you can override and do whatever u want in the child class. thats the reason u extend a class and override a method to get some completely different operations done.

    you can check out this link for the details

    Author Comment

    Yes, thanks for the links in your previous post.  I read that and just wanted to make sure I understood what I was reading.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Learn The Basics of Ethical Hacking & Pen Testing

    Computer and network security is one of the fastest growing and most essential industries in technology, meaning companies will pay big bucks for ethical hackers. This is the perfect course to leap into this lucrative career, learning how to use ethical hacking to reveal ...

    Suggested Solutions

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now