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 is the function of static in java?

539


What is composition in java?

723


Does substring start with 0?

552


Differentiate between nested and inner class in java.

554


Explain the difference between comparator and comparable in java?

484






What is immutable state?

506


Can we pass a primitive type by reference in java? How

530


How do you declare an array in java?

517


Are variables stored in ram?

553


What are scalar data types?

524


Can we restart a dead thread in java?

552


Explain methods specific to list interface?

553


What is the difference between method overriding and overloading?

578


Can a hashset contain duplicates java?

492


Is alive method in java?

506