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

Difference between notify() method and notifyall() method in java?

769


If a method is declared as protected, where may the method be accessed?

760


What is remote method invocation (rmi)?

832


What does replaceall do in java?

715


What is double parsedouble in java?

776


How do you escape sequences in java?

826


How is java created?

739


Can a class be final?

716


What is use of static method?

778


What exactly is a .class file?

828


What is a ternary operator in java?

772


How to create packages in java?

740


What are the two types of java?

780


Is java a software?

726


Is logger a singleton?

739