Method Overriding Vs Method Hiding in JAVA
package com.interview;
public class MethodOverriding {
public static void main(String[] args) {
A obj = new B();
obj.test();
A.test1();
B.test1();
}
}
class A {
void test() {
System.out.println("In TEST A");
}
static void test1() {
System.out.println("In Static TEST A");
}
}
class B extends A {
@Override
void test() {
System.out.println("In TEST B");
}
static void test1() {
System.out.println("In Static TEST B");
}
}
On this page of the site you can watch the video online Method Overriding Vs Method Hiding in JAVA with a duration of hours minute second in good quality, which was uploaded by the user Think Programmatically 31 January 2023, share the link with friends and acquaintances, this video has already been watched 242 times on youtube and it was liked by 17 viewers. Enjoy your viewing!