. What are the differences between constructor and method of a class in Java?
Answer Posted / nashiinformaticssolutions
Initializing the state of the object is done by constructors. A function Object () { [native code] }, like methods, contains a group of statements (or instructions) that are carried out when an object is created. A method is a group of statements that work together to complete a certain task and return the outcome to the caller. A method has the option of working without returning anything.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What do you mean by flow of struts?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What do you mean by formatting?
What is the difference between math floor and math round?
what is predefined function in java?
What is a ?
when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???
State two differences between C and Java.
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
What is Java Reflection API? Why it’s so important to have?
What is the hashcode () and equals () used for?
Difference between default and protected access specifiers?
Write an algorithm for quick sort?
What is null object in java?
How will you serialize a singleton class without violating singleton pattern?