What is static variable and static method?

Answers were Sorted based on User's Feedback



What is static variable and static method?..

Answer / aravind

a variable declared inside a method is local to that method.
it can't be accessed outside the method. if a variable
declared in a class means its a global variable.if we
declare a variable with static keyword in a class means it
can be accessed by all the class.

Is This Answer Correct ?    18 Yes 22 No

What is static variable and static method?..

Answer / ravikiran(aptech mumbai)

static variable is a class variable which value remains
constant for the entire class
static method is the one which can be called with the class
itself and can hold only the staic variables

Is This Answer Correct ?    43 Yes 63 No

Post New Answer

More Core Java Interview Questions

What is the Scope of Static Variable?

1 Answers   Verifone,


What is time complexity java?

1 Answers  


What does regex mean?

1 Answers  


What is garbage collection? Can it be forced to run?

1 Answers   Global Logic,


What is the difference between the size and capacity of a vector?

1 Answers  


How do you write a conditional statement?

1 Answers  


what invokes a threads run() method? : Java thread

1 Answers  


How do you create immutable object in java?

1 Answers  


Can sleep() method causes another thread to sleep?

1 Answers  


Does a function need a return?

1 Answers  


Under what conditions is an object’s finalize() method invoked by the garbage collector?

1 Answers  


What is method in java ?

1 Answers  


Categories