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

What is an Exception ?

10 Answers  


Can static methods be overridden?

5 Answers   Bravura Solutions,


What is append function?

0 Answers  


What is indexof?

0 Answers  


Is vector ordered in java?

0 Answers  


What is the reason behind using constructors and destructors?

0 Answers   HCL,


What 4 doubled?

0 Answers  


Can we override private method?

0 Answers  


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

0 Answers   Fidelity,


What is java full form?

0 Answers  


Can java cast null?

0 Answers  


what is platform dependent translation and platform dependent programming language

2 Answers  


Categories