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

How many types of classes are there in java?

0 Answers  


Which language is java?

0 Answers  


Explain 5 io best practices?

0 Answers  


What is the purpose of the runtime class in java programming?

0 Answers  


What is abstract class? Explain

0 Answers  






What is the benefit of inner classes in java?

0 Answers  


What is the difference between error and exception and explain in simple words not whatever is given in the book.

7 Answers  


System.out.println(101/14) what is the output? a)6 b)14 c)7.14 d)0

8 Answers   Accenture,


Hi, well i am unable to understand that why it is mandatory to have same hashcode, if two objects are same? Thanks in advance.

5 Answers  


What is a module function?

0 Answers  


Why do we need singleton class?

0 Answers  


what is an object class?Explain its methods?

6 Answers  


Categories