Can we override static methods?

Answer Posted / yogesh gandhi

Neha,

I didn't get your answer.
You can overload as well as override static methods, but
only with static methods.

I have tried it and it is getting compiled.

Example is here.
*********************************************************
public class abc
{
public static void main(String args[])
{

}
public static void trss()
{

}
public static void trss(int i)
{
}

}
*********************************************************

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are latest features introduced with java 8?

580


What’s the difference between the methods sleep() and wait()?

532


What are voids?

526


What are annotations in java?

614


What is the purpose of static methods and variables?

523






What is finally in Java?

568


What is slash r?

532


Difference between arraylist and vector.

580


does java support pointers?

554


How much is a java license?

517


Why we use set in java?

504


What is the difference between a static and a non-static inner class in java programming?

515


What is meant by singleton class?

587


Explain differences between collection api and stream api?

601


Why string is not a wrapper class?

636