Can we override static methods?

Answer Posted / rambabu

Yes, We can! see Below---
public class Final1 {
public static void mone() {
System.out.println("Iam in final method of
super class");
}
}
public class Final extends Final1{

public static void mone() {
System.out.println("Iam in final method of
sub class");
}
public static void main(String a[]) {
Final f = new Final();
f.mone();
}

}

Is This Answer Correct ?    0 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is functional interface in javatpoint?

516


State the main difference between c++ and java?

594


What is the final keyword in java?

558


Give me some null interfaces in java?

609


what is instanceof operator used in java?

597






What are features of java?

564


Break statement can be used as labels in java?

556


Explain what is encapsulation?

613


How do you escape in java?

581


What is formatted output?

516


what is ststic with example

1599


What are the types of methods in java?

582


What was java originally called?

515


What are the basic concepts of OOPS in java?

571


What are loops in java? What are three types of loops?

554