What are field variable and local variable?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / monoranjan gorai
Field Variable is a member of a class whereas Local Variable is a member of a method.
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / ravikiran(aptech mumbai)
field variable is the one which can have different access
local variable access restict to method only
Is This Answer Correct ? | 8 Yes | 9 No |
how can you catch multiple exceptions in java?
What is deserialization?
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.
How many bits is a boolean?
What is the meaning of variables in research?
Why do we use regex?
What is the size of string?
Can we use switch statement with strings?
what is overloading in java?
13 Answers Ascent, DNS, Infosys, SDA, VelTech,
How to connect to a remote database using Applet?
Enlist few advantages of inheritance?
What is Transient and volatile