Can we declare variables inside a method as Final Variables?

Answers were Sorted based on User's Feedback



Can we declare variables inside a method as Final Variables?..

Answer / therathna

write a small program and check ur system

we can use final variable method

Is This Answer Correct ?    15 Yes 2 No

Can we declare variables inside a method as Final Variables?..

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

Can we declare variables inside a method as Final Variables?..

Answer / ravikiran(aptech mumbai)

yes we can declare.

Is This Answer Correct ?    12 Yes 1 No

Post New Answer

More Core Java Interview Questions

How destructors are defined in java?

0 Answers  


Why is static used?

0 Answers  


Give the difference between the println method and sqrt method?

0 Answers  


What modifiers are used for interface declaration?

7 Answers  


What is ide with example?

0 Answers  






How to avoid the runtime exception ?

2 Answers  


Write a program to print fibonacci series up to count 10.

0 Answers  


How many unicode characters are there?

0 Answers  


What is Three tier architecture. Can anyone explain with a Ordinary web application Project? (JSP,Servlets,JAVA,DAO) ?

3 Answers   TCS,


Does unicode support all languages?

0 Answers  


Can you make a constructor final in Java?

0 Answers   SwanSoft Technologies,


How are the elements of a gridbaglayout organized in java programming?

0 Answers  


Categories