Explain final, finalize() and finally?

Answer Posted / venkataramana

final is a keyword.
we can use the final keyword in different context.
final keyword can be used with 1.Variables
2.Methods
3.Classes

When we use the final keyword with variables ,the value of
the final variable will not be changed i.e its value will be
fixed .

when we use the final keyword with methods, that is the
final method cannot be overridden.

when we use the final keyword with classes, that is the
final class cannot be extended to subclasses.

Finally() block is followed after try() or catch() block.
Finall() block executed even though if there the exception
having or not in the program.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java util?

524


What does a method signature consist of?

500


Can a method be overloaded based on different return type but same argument type?

539


How to disable caching on back button of the browser?

517


What is ascii format?

539






What is the best definition for data?

506


What is a predicate method?

555


How to perform quicksort in java?

556


What is tostring () method?

534


Can we define static methods inside interface?

511


What is the significance of listiterator?

559


How do you use compareto?

540


Give me an example of array and linked list? Where they can be used?

547


What are the topics in core java?

518


What about member inner classes?

617