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 array and arraylist in java?

0 Answers  


why would you use a synchronized block vs. Synchronized method? : Java thread

0 Answers  


What are the different types of multitasking?

0 Answers  


What do you understand by an io stream?

0 Answers  


what is meta-Inf?

2 Answers   Polaris,


Explain parallel processing in java8?

0 Answers  


Explain polymorphism citing an example.

0 Answers   Amazon,


What is jvm? Why is java called the platform independent programming language?

0 Answers  


Is .net better than java?

0 Answers  


What are the main uses of this keyword?

0 Answers  


Can a class have multiple subclasses?

0 Answers  


Explain java coding standards for classes or java coding conventions for classes?

0 Answers  


Categories