In what circumstances, compiler will supply a default
constructor for a class?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What do you mean by light weight and heavy weight components?
Can u overload main()method.Give with example.
6 Answers IBM, Schimatic Technologies,
What is difference between protected and private?
What does this() represent, and how is it used in Java?
What is the difference between import java.util.date and java .util?
how to execute main()
Write a program to check string is palindrome without using loop?
Can a Byte object be cast to a double value?
How do you declare a string variable?
What is better - 'bit-shift a value' or 'multiply by 2'?
What is the purpose of return statement?
Give reasons supporting that string is immutable.