How destructors are defined in java?



How destructors are defined in java?..

Answer / Kunwar Akram Ali

Destructors (like C++ counterparts) are not supported in Java. Instead, the concept of Finalization is used. An object's finalize() method is called by the garbage collector right before the object is destroyed. However, you cannot define destructors as per Java language rules.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

finalize() method?

5 Answers  


Add a value x to array from index l to r where 0 <= l <= r <= n-1

1 Answers   Amazon,


What is an interoperable application in java ?

1 Answers   HCL,


The following program is Overloading or Overriding? public class PolymorphismEx { public int sampleMethod(int a) { return a; } public String sampleMethod(int a) { return "Is it Overloading or Overriding???"; } }

4 Answers   Ness Technologies, TCS,


What is the synonym of procedure?

1 Answers  


What is an empty class? What functionality does it offer in Java?

1 Answers   Deloitte, EXL, JPMorgan Chase,


Define a package.

1 Answers  


How many bits is a string in java?

1 Answers  


Difference between Application and Applet ?

4 Answers   Wipro,


worst case complexities of Quick sort and Merge sort.

1 Answers   Amazon,


Which is better arraylist or vector?

1 Answers  


Why volatile is used in java?

1 Answers  


Categories