Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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 1 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 ?    12 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 many ways can we create singleton class?

0 Answers  


what is use of threads how many ways to create thread

3 Answers   iTrust, Verizon,


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

0 Answers   Mphasis,


Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?

0 Answers  


how to print the below in java? * * * * * * * * *

2 Answers  






What is purpose of applet programming?

0 Answers  


what is method reference in java 8?

0 Answers  


What is file class and what is its purpose?

1 Answers  


What is CardLayout?

1 Answers   Infosys,


Can we instantiate Interfaces?

7 Answers   Ericsson,


What is difference between pointer and reference?

0 Answers  


What is main difference between variable and constant?

0 Answers  






Categories