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 a treeset class?

562


Explain wait() method of object class ?

638


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

602


What does int argc char * argv [] mean?

524


What do you understand by private, protected and public?

531






How do you calculate square roots?

581


Explain when noclassdeffounderror will be raised ?

624


Is it possible to instantiate the abstract class?

542


What are the advantages of user defined functions?

562


What is a loop java?

592


Under what conditions is an object’s finalize() method invoked by the garbage collector?

583


4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (

1419


How will you reverse a link list without using recursion?

603


Explain about OOPS concepts and fundamentals.

598


What is the use of using enum to declare a constant?

562