What is the difference between constructor and method?

Answer Posted / pinky

Constructor doesnt return anything. where as method may or
may not return data or value

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a consumer in java?

653


What is difference between identifier and variable?

575


How to instantiate member inner class?

728


What will happen if static modifier is removed from the signature of the main method?

608


What is an argument java?

613






Why synchronization is important?

670


What are the advantages of defining packages in java?

614


How does sublist works in java?

623


In a container there are 5 components. I want to display all the component names, how will you do that?

1650


What is parse method?

638


What is string [] args?

653


What are the differences between the constructors and methods?

689


What is string data type?

641


In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?

654


State the difference between creating string as new () and literal.

609