PhysicsTeacher.in

High School Physics

overriding

Java Program – overriding a method inherited from Object class

Here is a Java program that helps you to understand how to override a method. In this program, a class overrides the “equals” method inherited from the Object class in Java. Java program to Override a method inherited from Object class in Java class Room{int l,b,h;Room(int l,int b,int h){this.l=l;this.b=b;this.h=h;} void show(){System.out.println(“DATA:”+l+” “+b+” “+h);} /* overriding […]

Scroll to top
error: physicsTeacher.in