What is the difference between method and constructor ?
Answer Posted / malli
constructor: 1)It is special type of member function.
2)it should not support any return type.
3)it should not support any static and final
4)mainly we can use for object initialization
method:
1)it is normal member function
2)it support return type and static final.
3)methods for to develop business logic we can use.
Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
How to implement a multithreaded applet?
Can we create an object of private class?
Is singleton class thread safe?
Can static methods be inherited?
What is synchronization and why is it important in java programming?
Explain the available thread states in a high-level?
Why are the objects immutable in java?
what do you mean by stream pipelining in java 8? Explain
How can we use primitive data types as objects?
What is default size of arraylist in java?
What is a 16 bit word?
In java how do we copy objects?
What is Classloader in Java?
What is the purpose of using the java bean?
What are the steps involved to write rmi based programs?