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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between synchronized and synchronized block?

1016


What are the legal parameters?

955


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

1014


What is the java reflection api? Why it’s so important to have?

936


What is default size of arraylist in java?

1084


What does the exclamation mark mean in java?

1189


What is classes in java?

899


What are the differences between include directive and include action?

1101


what do you mean by classloader in java?

984


is it possible to instantiate the math class?

980


Is java a virus?

901


How do I remove a character from a string in java?

933


How do you avoid global variables?

1035


Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

1012


What is lazy initialization in java?

953