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
What are the important features of Java 9 release?
Can we have 2 main methods in java class?
What do you understand by access specifiers in Java?
what is bmg file and how to create that files?what will it contailn?
What are the features of junit?
What are computer functions?
What exactly is java?
What is nan in java?
If I only change the return type, does the method become overloaded?
What is the difference between access specifiers and access modifiers in java? 16
Are arrays classes in java?
What is use of map in java?
What are the basic control structures?
How do you insert a line break?
Is a char always 1 byte?