Answer Posted / ranganathkini
Variables declared outside any method/constructor but inside
the class block, is a field variable.
Variables that are declared within a method or a specific
block of statements are local variables.
Local variables are kept alive as long as the execution is
within the block they're defined in. Once the block is
exited, the local variables can no more be used.
Field variables have longer life than local variables in
that they can live as long as the instance they belong to is
active.
| Is This Answer Correct ? | 30 Yes | 4 No |
Post New Answer View All Answers
What is java command?
What is private static in java?
What is token in java?
Name container classes in java programming?
What do you mean by checked exceptions?
Explain listiterator and methods in listiterator?
What is the difference between procedural and object-oriented programs?
What is parse method?
What are the different types of sorting in java?
What is command line argument
Can I override protected method in java?
What is the difference between overriding & overloading?
What is an arraylist in java?
Is arraylist sorted in java?
What is constructor and its types?