Can you declare a static variable in a method?

Answer Posted / venkatesh

No we can't declare a static variable in a method.
only final and default scope variables are allowed inside
the method

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does singleton mean in java?

501


Differentiate between stringbuffer and stringbuilder in java.

546


What is java virtual machine and how it is considered in context of java’s platform independent feature?

640


explain local datetime api in java8?

549


What are the types of methodology?

499






What is the difference between an object-oriented programming language and object-based programming language?

555


Have you ever used hashtable and dictionary?

564


What is the difference between conversation & casting?

563


What is the major difference between linkedlist and arraylist?

501


How can you handle java exceptions?

517


What are the methods to rectify ambiguities in the interfaces in JAVA?

579


What is string args [] in java?

533


What are the restrictions imposed by a Security Manager on Applets?.

2055


Does variable declaration allocate memory?

575


Can I learn java without any programming experience?

542