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

Describe the Big-O Notation.

615


Why does java does not support multiple inheritance? Explain

549


When parseint method can be used?

541


What are functions in java?

501


What is currentthread()?

575






What is the use of http-tunneling in rmi?

555


If a method is declared as protected, where may the method be accessed?

534


Is 0 a prime number?

572


Explain a few methods of overloading best practices in java?

511


Why can't we use static class instead of singleton?

503


Explain about procedural programming language or structured programming language and its features?

548


What does singleton mean in java?

508


What is listnode in java?

537


What is array sorting in java?

557


What does business logic mean?

505