What is meant by local variable and instance variable?



What is meant by local variable and instance variable?..

Answer / Kana Ram Yogi

A local variable is a variable declared within a method, block, or scope, which can only be accessed inside that specific method, block, or scope. An instance variable, also known as an object variable, is a member variable of a class, accessible from any method in the same class and from methods in its subclasses.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is stream api in java8?

1 Answers  


What's the purpose of static methods and static variables?

1 Answers  


What is a get method?

1 Answers  


What is the intersection and union methods?

1 Answers  


List some features of the abstract class.

1 Answers  


What is difference between wait and notify in java?

1 Answers  


Can we create an object of private class?

1 Answers  


How to find the index of the largest number in an arraylist java?

1 Answers  


Can we make a constructor final?

1 Answers  


What do you mean by of string::valueof expression in java 8?

1 Answers  


Do you need to import math in java?

1 Answers  


What is meant by inheritance and what are its advantages?

1 Answers  


Categories