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 r character?
What is the best way to findout the time/memory consuming process?
What is the difference between abstract classes and interfaces?
What is string syntax?
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
What is the difference between a static and a non-static inner class in java programming?
Explain the protected field modifier?
Is java 11 paid version?
What is the use of keywords in java?
How can you set the applet size?
How can you read content from file in java?
Is a method a procedure?
What is the use of accept () method in java?
How many decimal places is a double?
Can we define private and protected modifiers for the members in interfaces?