In what circumstances, compiler will supply a default
constructor for a class?

Answers were Sorted based on User's Feedback



In what circumstances, compiler will supply a default constructor for a class?..

Answer / uthrakumar-wipro technologies

if there is no constructor was defined explicitly it will
define the default constructor...the logic in this was we
are creating a constructor with out our knowledge while
creating an object as follows....

<classname> <obj>=new <classname()>------this is
the constructor we are defining .............

Is This Answer Correct ?    1 Yes 0 No

In what circumstances, compiler will supply a default constructor for a class?..

Answer / ranganathkini

If no constructors are explicitly defined for the class,
Java supplies a default no-arg constructor which does
nothing more than initialize the fields of the class to
their default value.

Is This Answer Correct ?    0 Yes 0 No

In what circumstances, compiler will supply a default constructor for a class?..

Answer / ravikiran

when ther is no other constructor defined

Is This Answer Correct ?    0 Yes 0 No

In what circumstances, compiler will supply a default constructor for a class?..

Answer / vijayakumar chinnasamy

If there is no constructor in the class , then the compiler
create a default constructor with access specifier of class.


class A{ } - compiler create default constructor for this
class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the static keyword?

0 Answers  


Is string is a keyword in java?

0 Answers  


How to convert String into primitive datatype.

6 Answers  


What is the difference between static method and instance method in Java?

0 Answers   SwanSoft Technologies,


Is it possible to instantiate the abstract class?

0 Answers  






when a servlet sends request for first time it uses the follwing methods a)init b)doget() c)dopost() d)service

4 Answers   Accenture,


What is a condition in java?

0 Answers  


Hai friends I am MCA 2006 passout. Spend time in 1 yr for teacing and 5 months in small s/w firm. worked in 4 or 5 months in few places. Presently I am writing bank exams. I want to get back to IT sector. Are there any possibilities. any growth prospects?. I am having some knowledge in core and advanced java. I am so desperate. Any suggestions thanks in advance. u can write to my mail mahidestiny@gmail.com

4 Answers  


What is constant in programming?

0 Answers  


What are aggregate functions explain with examples?

0 Answers  


What is difference between printf and scanf?

0 Answers  


What initialize variables?

0 Answers  


Categories