Can static method be overridden?

No, Static methods can’t be overridden because they are associated with class not with the object.

class MultiplicationTest {
 
    public static void multiplication(int num1, int num2) {
        System.out.println(num1 * num2);
    }
 
 }
 
public class Main extends MultiplicationTest
{
    public void multiplication(int num1, int num2) {
        System.out.println(num1 * num2);
    }
	public static void main(String[] args) {
		Main main = new Main();
		main.multiplication(15, 5);
	}
}

Output

Main.java:11: error: multiplication(int,int) in Main cannot override multiplication(int,int) in MultiplicationTest
    public void multiplication(int num1, int num2) {
                ^
  overridden method is static
1 error

Note: Static method will be inherited, so if we want to use them we can use as static methods present in sub class. But we can not override them.
Example

class MultiplicationTest {
 
    public static void multiplication(int num1, int num2) {
        System.out.println(num1 * num2);
    }
 
 }
 
public class Main extends MultiplicationTest
{
	public static void main(String[] args) {
		Main.multiplication(15, 5);
	}
}

Output

75

Java interview questions on method overloading and overriding

Please Share