Skip to header Skip to main navigation Skip to main content Skip to footer

User account menu

  • Log in
Home
COPA
Computer Operator and Programming Assistant

Main navigation

  • Home
    • COPA Assessment Criteria
    • COPA Job Role
    • Course Information
  • Books
  • Question Paper
  • Syllabus

Method Overriding in JAVA

Breadcrumb

  • Home
  • Introduction to Programming in Java
  • Method Overriding in JAVA

Network

ITI Trade Subject

  • ITI Electrician
  • ITI Fitter
  • ITI COPA
  • ITI Welder
  • ITI Mechanic
  • ITI Electronics
  • ITI Wireman
  • ITI Draughtsman Civil & Mech
  • ITI Refrigeration & Air Conditioning
  • ITI Turner
  • ITI Plumber
  • ITI Machinist
  • ITI Cosmetology
  • ITI Sewing
  • ITI Surveyor
By Anand | 12:50 PM IST, Fri March 13, 2026

Method Overriding in Java

Java is an object-oriented programming language that allows developers to build flexible and reusable software systems. One of the important concepts in object-oriented programming is method overriding. Method overriding allows a subclass to provide its own implementation of a method that is already defined in its parent class.

Method overriding is mainly used to achieve runtime polymorphism in Java. It allows a program to determine which method should be executed during runtime depending on the object that calls the method.

For students studying the ITI COPA (Computer Operator and Programming Assistant) trade, understanding method overriding is important because it helps create dynamic and flexible Java programs.

What is Method Overriding?

Method overriding occurs when a subclass defines a method with the same name, return type, and parameter list as a method in its superclass. The subclass method replaces or overrides the implementation of the parent class method.

When the overridden method is called using an object of the subclass, the method defined in the subclass is executed instead of the one in the parent class.

Syntax of Method Overriding

class ParentClass {

    void display() {
        System.out.println("Parent class method");
    }

}

class ChildClass extends ParentClass {

    void display() {
        System.out.println("Child class method");
    }

}

In this example, the display() method in the child class overrides the display() method in the parent class.

Example Program of Method Overriding

class Animal {

    void sound() {
        System.out.println("Animal makes sound");
    }

}

class Dog extends Animal {

    void sound() {
        System.out.println("Dog barks");
    }

}

public class TestOverride {

    public static void main(String[] args) {

        Dog d = new Dog();
        d.sound();

    }

}

Output:

Dog barks

In this program, the Dog class overrides the sound() method defined in the Animal class.

Rules of Method Overriding

There are certain rules that must be followed when overriding methods in Java.

  • The method name must be the same as the parent class method.
  • The parameter list must be identical.
  • The return type must be the same or compatible.
  • The overriding method must not reduce the access level.
  • The method must be inherited from the parent class.

Following these rules ensures that method overriding works correctly.

The @Override Annotation

Java provides a special annotation called @Override which indicates that a method is overriding a method from the parent class.

Using this annotation helps the compiler detect errors during compilation.

class Animal {

    void eat() {
        System.out.println("Animal eats food");
    }

}

class Dog extends Animal {

    @Override
    void eat() {
        System.out.println("Dog eats meat");
    }

}

Although the @Override annotation is optional, it is recommended for better readability and error checking.

Using the super Keyword

The super keyword is used to refer to the parent class object. It can be used to call the parent class method from the child class.

class Animal {

    void eat() {
        System.out.println("Animal eats food");
    }

}

class Dog extends Animal {

    void eat() {
        super.eat();
        System.out.println("Dog eats meat");
    }

}

In this example, the Dog class first calls the eat() method of the Animal class and then adds its own behavior.

Runtime Polymorphism

Method overriding helps achieve runtime polymorphism, which means the method call is resolved during program execution.

Example:

class Animal {

    void sound() {
        System.out.println("Animal sound");
    }

}

class Cat extends Animal {

    void sound() {
        System.out.println("Cat meows");
    }

}

public class Test {

    public static void main(String[] args) {

        Animal a = new Cat();
        a.sound();

    }

}

Output:

Cat meows

Although the reference type is Animal, the method of the Cat class is executed at runtime.

Difference Between Method Overloading and Method Overriding

FeatureMethod OverloadingMethod Overriding
DefinitionSame method name with different parametersSubclass redefines parent class method
Class LocationSame classParent and child classes
InheritanceNot requiredRequired
ExecutionCompile-timeRuntime

Advantages of Method Overriding

  • Supports runtime polymorphism
  • Allows modification of inherited behavior
  • Improves program flexibility
  • Promotes code reuse

These advantages make method overriding an important feature in object-oriented programming.

Applications of Method Overriding

Method overriding is used in many real-world Java applications.

  • Graphical user interface frameworks
  • Game development
  • Web applications
  • Enterprise software systems

Many Java frameworks rely heavily on overridden methods to allow developers to customize behavior.

Importance for ITI COPA Students

For students studying the ITI COPA trade, learning method overriding helps in understanding how object-oriented programs behave at runtime.

This concept allows students to design flexible software where different classes can provide their own implementations of methods.

Understanding method overriding also prepares students for advanced Java concepts such as polymorphism, interfaces, and framework development.

Conclusion

Method overriding is an important concept in Java that allows a subclass to redefine the behavior of a method inherited from its parent class.

It plays a key role in achieving runtime polymorphism and creating flexible software applications.

For ITI COPA students, mastering method overriding helps build a strong foundation in object-oriented programming and prepares them for developing professional Java applications.

Book traversal links for Method Overriding in JAVA

  • ‹ Method Overriding in JAVA
  • Up
  • Object Oriented Programming with Core Java ›
  • Printer-friendly version

Article

Types of Files in Computer System
Safety Signs and Symbols Used in Workplace
Safety Rules While Using Computer
Can I start my own business after doing ITI in COPA trade?
Scope in Government Jobs after Doing ITI in COPA

Books

Introduction to Programming in Java
Programming language (Python)
Cloud Computing
Cyber Security
Advanced Excel Concepts
Database Concepts
Communicating in a Connected World
Using Spread Sheet Application
Designing Static Web Pages
Internet Concepts
Configuring and Using Networks
Database Management
Image editing, Creating presentations & Using Open Office
Using Word Processing Software
Familiarization with DOS CLI & Linux Operating Systems.
🖥️ Computer Hardware Basics and Software Installation
🖥️ Computer Components and Windows Operating System
Cyber Security
E Commerce
Smart Accounting
Introduction to VBA, Features and Applications
Introduction to JavaScript 🧠💻
Web Design Concepts
Internet Concepts 🌐
Networking Concepts 🌐
🗄️ Database Management Systems (DBMS)
Power Point Presentations
📊 Spreadsheet Application – Trade Theory for COPA
📝 Word Processing – Trade Theory for COPA
🖥️ Introduction to DOS Command Line Interface & Linux Operating System – Trade Theory for COPA
🖥️ Computer Hardware Basics and Software Installation – Trade Theory for COPA
Introduction to Computers and Windows Operating System

Question Paper

Hindi

COPA 2024 – प्रश्न पत्र सेट 11
COPA 2024 – प्रश्न पत्र सेट 1
COPA 2024 – प्रश्न पत्र सेट 2
COPA 2024 – प्रश्न पत्र सेट 3
COPA 2024 – प्रश्न पत्र सेट 4
COPA 2024 – प्रश्न पत्र सेट 5
COPA 2024 – प्रश्न पत्र सेट 6
COPA 2024 – प्रश्न पत्र सेट 7
COPA 2024 – प्रश्न पत्र सेट 8
COPA 2024 – प्रश्न पत्र सेट 9
COPA 2024 – प्रश्न पत्र सेट 10

English

ITI COPA 2023 Question Paper
ITI COPA 2023 Question Paper – Set 2
ITI COPA 2023 Question Paper – Set 3
ITI COPA 2023 Question Paper – Set 4

Common Subject

  • Engineering Drawing
  • Employability Skills
  • Workshop Calculation Science

Directory

  • Industrial Training Institutes
  • Engineering College
  • Medical College

Knowledge Bank

  • ITI Syllabus
  • Tools

Copyright © 2026 Company Name - All rights reserved

Developed and Designed by Alaa Haddad at Flash Web Center, LLC