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

How do you check if a character in a string is a digit or letter?

482


How to make a write-only class in java?

556


What are thread safe functions?

484


What is supplier in java?

523


Can we access the non-final local variable, inside the local inner class?

495






What is derived datatype?

599


How does split work in java?

509


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

503


What are the five major types of reference sources?

506


What is a flag variable?

538


What is t type java?

601


Is main an identifier?

524


What is a java lambda expression?

525


What are the types of web technologies?

500


What is java instanceof operator?

534