Differentiate constructor and a method and how are it be
used?
Answer Posted / teju
constructor: It is one special member function.it has name same like class .it does not have any return type.it gets executed when we create an object of class and invokes implicitly. constructor is used to initialize the variables ,start the thread
method:
it gets executed explicitly when object is created . it has return type .
method is used to invoke the task or block of code
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Are arrays passed by reference in java?
What is vector?
Explain the difference between map and flatmap stream operation?
Why are data types important?
Why is java architectural neutral?
What is internal variable?
What is unmodifiable collection in java?
What are inbuilt functions?
Explain the overview of UDP messaging.
Is void a wrapper class?
What is difference between c++ and java ?
What is string pooling concept?
Explain illegalmonitorstateexception and when it will be thrown?
What are wrapper classes in java?
Explain how to convert any java object into byte array.