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 |
What's the access scope of protected access specifier?
Why should we use java?
how can you take care of mutual exclusion using java threads? : Java thread
Why packages are used?
What is meant by bytecode?
I have one POJO class(Java bean class), it has two variables for that it has setters and getters. Now i have created two objects for that class and i have set the data for those variables through this two objects. Now question is i want check whether those two objects have same data or not, for this write a program? Thanks, Bose.
How can we create a object of a class without using new operator.
how many ways we can serialize the java object?
What is a treeset in java?
What is Java Annotations?
Why do we need to override equals() and hascode() method of object class?
Define inheritance?