Can we declare variables inside a method as Final Variables?
Answers were Sorted based on User's Feedback
Answer / therathna
write a small program and check ur system
we can use final variable method
| Is This Answer Correct ? | 15 Yes | 2 No |
Answer / 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 |
Is void a keyword in java?
What is a condition in programming?
Which language is java?
What is use of set in java?
What is nested interface?
Describe different states of a thread.
What are the characteristics of java?
What is the difference between C++ and Java and your preferences?
What are the 6 functions?
What is a map in java?
How is final different from finally and finalize?
What is private protected in java?