Amazon Interview Question
Software Engineer / Developersi am not a java expert but i think that final has many uses as a:
1. variables: a final variable can be set once and only once.
2. fields: a final field can also be set only once, by the constructor of the class which defines it.
3. methods: a final method cannot be overridden nor hidden.
4. classes: a final class cannot be extended.
well when you declare a variable or method as final it is as good as const in C++.
- B April 28, 2007when you declare a method finally, it will be executed for sure before the termination of the program even if a fatal exception is thrown.
don't have any idea about finalize, anybody from Java can throw some light also pls correct me if i am wrong i am a C++ guy.