what are variables in java

Answer Posted / hemanta paudel

Every data are store in memory and that memory has literal
name that is called variable.There are two type of variable
in java
1. Local variable :- that variable which is declare in
method body or argument list called as local variable and
its are store in stack.
2. Instance Variable:-those variable which are declare
within a class and obtain the memory when the instance of
class is created. Each instance have own variable.

3. Static or class variable:- those variable which are
declare using static keyword and they are load in memory
when class is loaded.

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?

1820


Can we increase size of array?

559


Mention some interfaces implemented by linked list in java.

530


When should we create our own custom exception classes?

574


What is the buffer limit?

546






Why char array is favored over string for the storage of passwords?

549


Explain the difference between protected and default access.

509


What’s the difference between applets and standalone program?

522


What is flush () in java?

548


List the interfaces which extends collection interface?

525


What is an object in java and how is it created?

575


What is a module function?

550


Can final class have constructor?

490


What do you understand by Header linked List?

586


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

823