. Differentiate between instance and local variables.

Answer Posted / nashiinformaticssolutions

For instance, variables are declared inside a class, and the limited to only a specific object.
A local variable can be anywhere inside a method or a specific block of code. Also, the scope is limited to the code segment where the variable is declared.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are singleton services?

656


What is byte data type?

737


Why does it take so much time to access an applet having swing components the first time?

1640


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

10031


What do you understand by the term polymorphism?

813


What are the common uses of "this" keyword in java ?

762


Is it possible to use Semaphore/ Mutex in an Interrupt Handler?

736


How can you make a class serializable in java?

760


Is it possible to specify multiple jndi names when deploying an ejb?

745


How transient variable is different from volatile variable?

756


What are the advantages of passing this into a method instead of the current class object itself?

1392


Why java is considered as platform independent?

763


What are the steps involved to write rmi based programs?

758


What is numeric data type?

721


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

860