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 bytecode verifier?

0 Answers  


when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???

0 Answers   SAP Labs,


Difference between String and StringBuffer.

3 Answers   GE, IBM,


What is the final blank variable?

0 Answers  


make a method which any number and any type of argument and print sum of that arguments.....

0 Answers  






How the elements are organized in BorderLayout?

5 Answers  


How is object created in java?

5 Answers   Cap Gemini,


What is difference between final and immutable?

0 Answers  


What is treeset in java?

0 Answers  


how session will be expired?

5 Answers   CybAge, Infosys,


Explain about anonymous inner classes ?

0 Answers  


I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do?

3 Answers   KPIT,


Categories