Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 java volatile?

0 Answers  


What is variable declaration and definition?

0 Answers  


why we need this (1.object,2.class,3.data hiding,4.encapsulation,5.abstraction,6. polymorphism,7.inheritance)

2 Answers  


What are the Object and Class that classes used for?

3 Answers   Mphasis,


Why isn’t there operator overloading?

0 Answers  


What is lazy initialization in java?

0 Answers  


How do you compare two strings? any predefined method for this?

3 Answers  


What is string builder in java?

0 Answers  


10. What is the output of the following Java program? class Main { public static void main(String args[]){ final int i; i = 10; System.out.println(i); } } 10. What is the output of the following Java program? class Main { public static void main(String args[]){ final int i; i = 10; System.out.println(i); } }

0 Answers  


Why do we use variables?

0 Answers  


What is a dot notation?

0 Answers  


What are the differences between Java 1.0 and Java 2.0?

0 Answers  


Categories