wat is final...?
wat is finally...?
wat is finalize....?
difference between " final and finally and finalize "...?

Answer Posted / mmkrish

final --> is a keyword. It will be used for variables,
methods and classes also.

final variables --> Cannot change their value.
final Methods --> Cannot override or overload
final Class --> it can never be subclassed.

finally --> is a block used in exception handling. Genrally
used along with try.catch blocks... though try or catch
block executes...finally block should execute at last.
Means, if we have add finally block, it will call though
there is an exeption occurs.

finalize() --> It is a method. This will be used in garbage
collection of java. It will clear all the unused
resources...Cannot Override. It is a protected method.

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which language is java?

548


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2376


What is :: operator in java 8?

560


What is the formula to calculate percentage?

540


What is bool mean?

575






What is stringwriter?

543


What is the use of http-tunneling in rmi?

557


What are strings in physics?

551


What does the “static” keyword mean? Can you override private or static method in java?

637


Is java call by reference?

534


What is java and its types?

555


How does compareto method work?

527


How do you define a variable?

541


Difference between linkedlist and arraylist.

597


What language is pass by reference?

574