What is the difference between Object and Instance?
Answers were Sorted based on User's Feedback
Answer / siva
instance means non-static variables memory location. Object means non-static variables + non-static methods memory location
| Is This Answer Correct ? | 11 Yes | 1 No |
For example, if I declare a class like
Animal a=new Animal();
Is variable 'a' in above is an instance which has an object of Animal type?
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / subba reddy
object means.
just create variable for class this is also called reference.
instance means.
create object for the class using new operator or new instance .
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / nagarjuna
Object is the creating memory location by using new operator
Instance is the creating the reference.
| Is This Answer Correct ? | 1 Yes | 4 No |
Answer / srinivaskumar.nimmana
All objects except array object are instances,i.e every object except array object can be instance but every instance may not be object.
| Is This Answer Correct ? | 1 Yes | 6 No |
Why is the singleton pattern considered to be an anti pattern?
When does Exception occurs?
What is the difference between throw and throws?
there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.
Does java trim remove newline?
what is the difference between HashMap And HashTable?
What is OOPS Concept?
What is meant by JVM ?
Is intellij better than eclipse?
Can we execute a program without main?
Explain creating threads by implementing runnable class?
Can we access a database using applets?