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 you know if a value is nan?
What is byte data type?
Are floats faster than doubles?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
Which is better ascii or unicode?
When does a class need a virtual destructor?
What do the thread?class methods run() and start() do?
How do you sort an array in java?
What is difference between throw and throws ?
How do you use wildcards?
What is an infinite loop in java? Explain with an example.
Why static functions are used?
What happens if an exception is not handled in a program?
How to create an immutable class?
Where we write javascript code in html page?