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

What is the purpose of javac exe?

550


For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green  White will have 1 Weight.  Red and Green carry no weights.  Shortest path is the path with less weight when you add up the weights in the path.

1575


Explain restrictions on using enum?

619


Explain the difference between transient and volatile in java?

569


How to sort elements in a parallel array in java?

497






Why can't we make a class private in java?

529


What is treeset and treemap in java?

566


What does void * mean?

523


How many bytes is a url?

556


Can constructor be synchronized?

527


What are encapsulation, inheritance and polymorphism?

519


What is the purpose of methodology?

631


Why we cannot override static method?

547


what is the difference between preemptive scheduling and time slicing? : Java thread

525


How can you add and remove nodes in jtree?

604