Can we declare variables inside a method as Final Variables?
Answer Posted / srinu
yes we can declare a varible as final variable inside method
public class Finalv
{
public void m1()
{
final int a=10;
System.out.println(a);
}
public static void main(String k[])
{
Finalv f=new Finalv();
f.m1();
}
}
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
How do I start learning java?
Why we go for collections in java?
What will be the output of round(3.7) and ceil(3.7)?
What is array length in java?
what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread
What is parsing in grammar?
What java ide should I use?
What is a stringbuilder?
Explain thread in java?
What are data types in programming?
Can a class be declared as protected?
What is the purpose of checked and unchecked exceptions in JAVA?
What do you know about the garbage collector in java?
What are internal and external variables?
Explain about OOPS concepts and fundamentals.