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 is Classloader in Java?
What is constant in programming?
How can we run a java program without making any object?
What language is pass by reference?
what is mena by object block any what is the use of that
What is structure of java heap? What is perm gen space in heap?
How to calculate the length of a singly linked list in java?
What is the difference between static method and instance method in Java?
Difference between class#getinstance() and new operator ?
Does treeset allow null in java?
How can we create objects if we make the constructor private ?
List some java keywords sun like c, c + + keywords?
What do heavy weight components mean in java programming?
what is the difference between yielding and sleeping? : Java thread
What are the differences between processes and threads?