Classes and Methods

34) A constructor is automatically called when an object is instantiated

a. true

b. false

Ans: a.

35) When may a constructor be called without specifying arguments?

a. When the default constructor is not called

b. When the name of the constructor differs from that of the class

c. When there are no constructors for the class

Ans: c.

36) Each class in java can have a finalize method

a. true


Ans: a.

37) When an object is referenced, does this mean that it has been identified by the finalizer method for garbage collection?


Ans: b.

38) Because finalize () belongs to the java.lang.Object class, it is present in all ___.




Ans: b.

39) Identify the true statements about finalization.

a.A class may have only one finalize method

b.Finalizers are mostly used with simple classes

c.Finalizer overloading is not allowed

Ans: a,c.

40) When you write finalize() method for your class, you are overriding a finalizer

inherited from a super class.



Ans: a.

Ref Link contributor :

Permanent link to Java Tutorials / Java Interview Questions: