why we cannot declare static variable inside a static method

Answer Posted / sachin kanojiya

Static variable initializes at the time of class load
(static variable initialize very first,after that static
method)that means static variable and method already define
but inside the static method can't declare static variable
because it is treat as static local member...

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a method signature java?

568


What is a final class in java?

539


Is there is any difference between a scrollbar and a scrollpane?

558


What are the types of methods in java?

576


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

598






Explain JMS in detail.

612


Program to Find the second largest element in an array.

580


What is unicode used for?

568


What does indexof return in java?

533


What are the types of casting?

592


What is the functionality of the stub?

567


What is an iterator java?

527


What is api data?

530


Which is the class in java?

514


Does .length start 0 java?

561