What is static variable and static method?
Answer Posted / abanish kumar rajoot
Static Varaibles & methods both are, class level
declaration means of it ,static varaibles are those which
are common for all the objects and the advantage of static
varaible over non-static is that they allocate memory space
at complitaion time means when a class gets load in memory.
and they remains in memory till class is loaded there.
Static methods are declared with static keyword and they
can be accessed by class name and only accessed static
variables.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain about features of local inner class?
What is the abstract class?
What are encapsulation, inheritance and polymorphism?
Why is java not 100% pure oops?
how does the run() method in runnable work? : Java thread
What is the current version of java?
What are the different ways of implementing thread? Which one is more advantageous?
What is difference between an object and a class?
Explain about object oriented programming and its features?
What is boolean in java?
What is the independent variable in an experiment?
What is a literal coding?
What is a subsequence of a string?
What is the purpose of the main method?
What is a java lambda expression?