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 |
When can an object reference be cast to an interface reference in java programming?
What is comparable and comparator interface? List their differences
What is the difference between private & public & friendly classes?
Can we declare register variable as global?
Difference String and String Buffer
What is the difference between hashset and treeset in java?
What is the major advantage of external iteration over internal iteration?
Explain when classnotfoundexception will be raised ?
What does exp mean in math?
Explain about static nested classes in java?
What are static initalizers in java ?
can two class in a code be public??if yes then how??