Thursday, January 31, 2019

overriding static methods example

package com.concretepage;
public class OverridingStaticMethods {
public static void method1() {
System.out.println("I am inside method1");
}
public static void method1(String a) {
    System.out.println("I am inside method1 of String2 " + a);
}
void method2() {
System.out.println("I am inside method2");
}
public static void main(String[] args) {
method1();
method1("Additional Comments");
}
}

No comments:

Post a Comment