What are the uses of final, finally and finalize in java?
Answer Posted / ch.soundarya
final is a keyword which is used on variable,method as well as on class.the variable with final keyword cannot be re used.and the method with final cannot be overrriden.the class with final keyword cannont be inherited.
FINALIZE:is amethod used for garbage collection .we can force finalize method explicitly for garbage collection.
FINALLY: it is method is used for close the allocated resources in a running program of java class.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What data type is true or false?
What is the difference between stringbuffer and stringbuilder class?
What are the advantages of inner classes?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread
What is variable and its types?
what is server side caching?
How arrays are stored in memory in java?
How many types of flags are there?
How hashmap works in java?
What are the differences between wait() and sleep()?
How does varargs work in java?
When object is created and destroyed?
What is meant by stack and queue?
Is it possible to compare various strings with the help of == operator? What are the risks involved?
What are new features introduced with java 8 ?