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 java and why do we need it? Explain

0 Answers  


what is stringtolennizer with example?

2 Answers   Symphony,


What is an event?

2 Answers  


which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None

17 Answers  


what is the purpose of the final in the try-catch-final

7 Answers  






Which collection is ordered in java?

0 Answers  


What is the purpose of the System class?

0 Answers  


What kind of variables a class can consist of?

0 Answers  


What are three advantages of using functions?

0 Answers  


Is hashmap thread safe?

0 Answers  


What is escape analysis algorithm in JVM and how garbage collection actually worked n how it transfer the objects from one kind of space to other?

0 Answers  


What is the difference between this() and super()?

15 Answers   TCS,


Categories