Can you declare a static variable in a method?

Answer Posted / muthusenthil

No, you can declare static variable only in static method

Is This Answer Correct ?    6 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how we can make a write-only class in java?

797


What is difference between null and void?

744


Is char a method in java?

764


What is meant by final class?

793


Is jdk required on each machine to run a java program?

1033


What is variable and constant explain with example?

785


What is bubble sort in java?

862


Can we declare a class as static?

818


Define reflection.

766


What is the difference between Array and Hash Table?

803


Write a program to reverse array in place?

811


What is generic class?

864


How do you differentiate abstract class from interface?

750


What is the use of flag?

869


Which one will take more memory: an int or integer?

1000