Differentiate constructor and a method and how are it be
used?
Answer Posted / pranab dutta
A constructor is a member function of a class that is used
to create objects of that class where as a method is an
ordinary member function of a class.
Constructor has the same name as the class itself and
Member has its own name.
A Constructor has no return type, and is invoked using the
new operator.. Whereas a Member has a return type (which
may be void), and is invoked using the dot operator.
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
What is the use of toarray () in java?
What is main string [] args?
Is java written in c?
How do you classify Dialog Box?
what is static import in java? Explain
What is break and continue statement?
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
what is a thread pool in java and why is it used?
How do you override a variable in java?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
What is hasnext in java?
What are the pillars of java?
what is an objects lock and which objects have locks? : Java thread
What is file in java?
How can we make a class singleton?