when there is cleanup activity needed before an object is destroyed
No. Once a method is declared final in a class, no derivative of that class can override that method.
Overriding a method means that you are replacing an existing or virtual method that has already been defined in the parent object class, so without using inheritance, there can be no existing method to override.
False.Any method declared as final cannot be overridden by any subclasses.You also cannot technically override a private method. While your subclass can have a method with the same definition as a private method in the superclass, it does not actually override that method.
Because, if two objects are supposed to be equal as per the equals() method, then the value returned by the hashCode() method must also be the same. This will not be the case if you override only the equals method and this can have some confusing effects when using those objects with hash related collections. So it is always a good idea to override the hashCode() method if you are providing an implementation for the equals method.
Finalize method is used when a variable becomes unreachable or of no use. it is finalize and garbage collection will free the memory used by it, which can be then reclaimed for some other variable
No. Once a method is declared final in a class, no derivative of that class can override that method.
You cannot override the jspService() method but you can override the jspInit() and jspDestroy() methods
Overriding a method means that you are replacing an existing or virtual method that has already been defined in the parent object class, so without using inheritance, there can be no existing method to override.
False.Any method declared as final cannot be overridden by any subclasses.You also cannot technically override a private method. While your subclass can have a method with the same definition as a private method in the superclass, it does not actually override that method.
Because, if two objects are supposed to be equal as per the equals() method, then the value returned by the hashCode() method must also be the same. This will not be the case if you override only the equals method and this can have some confusing effects when using those objects with hash related collections. So it is always a good idea to override the hashCode() method if you are providing an implementation for the equals method.
Hi, This is suneetha. We use Finalize() method in java instead of destructors. Finalize() is used to release the memory before the garabage collection takes place.
Finalizes are methods that objects can use to release resources before they are destroyed. The garbage collection part of the virtual machine is responsible for calling finalizes. The actual finalize method is called finalize (). This method
Finalize method is used when a variable becomes unreachable or of no use. it is finalize and garbage collection will free the memory used by it, which can be then reclaimed for some other variable
jsp init()
Default Constructor will be called first . If you override Validate method , then validate method will be called .
Finalize
Rx