Can You Overload or Override Static methods in Java
Can static method be overridden in Java, or can you override and overload static method in Java , is a common Java interview question, mostly asked to 2 years experienced Java programmers. Answer is, No, you can not override static method in Java , though you can declare method with same signature in sub class. It won't be overridden in exact sense, instead that is called method hiding . But at same time, you can overload static methods in Java, there is nothing wrong declaring static methods with same name, but different arguments. Some time interviewer also ask, Why you can not override static methods in Java ? Answer of this question lies on time of resolution. As I said in difference between static and dynamic binding , static method are bonded during compile time using Type of reference variable, and not Object. If you have using IDE like Netbeans and Eclipse, and If you try to access static methods using an object, you will see warnings. As per Java coding convention, static...