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

When should I use singleton?

703


Write code to implement bubble sort in java?

773


Which is better stringbuffer or stringbuilder?

721


What type of variable is gender?

752


What is thread count in java?

733


Explain the significance of listiterator.

779


What are data types in oop?

786


What is the point of java?

778


What are the loops in java?

747


Does printwriter create a file?

744


Explain an algorithm to find depth of a binary tree.

798


What are some alternatives to inheritance?

820


What is palindrome in java?

740


Why does java does not support multiple inheritance? Explain

745


What is a dot notation?

762