Java allows objects to initialize themselves when they are created using _________

A) Arguments
B) Classes
C) Constructors
D) Parameters

Showing Answers 1 - 8 of 8 Answers

shubhashini

  • Feb 10th, 2006
 

constructors

  Was this answer useful?  Yes

supriya.ahire

  • Mar 21st, 2006
 

hi,

  Ans is constructer.

   B'coz When a object is created following things are happen:

  1) Memory gets allocated to the object

  2) Constructer gets called.

  3) In constructer the object gets initialize.

  i think this will be sufficient to clear the topic..

Thanks & regards,

Supriya Ahire.

  Was this answer useful?  Yes

Yes objects can be created only using constructors if we do not provide one compiler will create a default cons for us thus allocating memory for objects we are going to create and the default values for instance variables are:

for integers, float, double, long, byte 0 is default value
for char a character whose
ASCII value is 0 and the char looks like a small square
for Boolean false
for String null
for objects null

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions