Explain role of constructor in a java application?

Answer Posted / harini

The main purpose of construtor is to initialize instance
variables.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Similarity and difference between static block and static method ?

541


Define packages in java?

580


What are static initalizers in java ?

586


Does java allow default arguments?

592


How to check if linked list contains loop in java?

461






Why java is a platform independent? Explain

536


How java uses the string and stringbuffer classes?

518


Is char a method in java?

520


What is size_t?

510


Can the garbage collection be forced by any means?

536


Why are arrays useful in java?

544


How to stop a thread in java? Explain about sleep () method in a thread?

590


What is a nested class?

598


Implement a stack with push (), pop() and min() in O(1) time.

640


Can java list be null?

558