how you will prevent method overriding?

Answer Posted / sumit

One can prevent method overriding by marking the method final. if you make a method static and reuse it in the subclass it will hide the the super class method. This is called method hiding rather than overriding.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

831


What is a Presistent Object?

900


Explain the access modifiers for a class, method and variables?

871


What are the topics in core java?

762


How do generics work in java?

681


how to write a server program and sending the mails to the server using smtp protocol please help me

1754


What is java reflection api?

733


What is the meaning of flag day?

731


What are the advantages of inner classes?

712


What is udp in java?

726


What are the steps involved to write rmi based programs?

758


How do you decide when to use arraylist and linkedlist?

726


What is the list interface?

815


Using callable statement how can you pass out parameters, explain with example?

845


What is this keyword in java?

773