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
why doesn't java run on all platforms?
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.
Can a class have more than one object?
How do I get 64 bit java?
how can you take care of mutual exclusion using java threads? : Java thread
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is the use of http-tunneling in rmi?
What are identifiers in java?
What is nested top-level class?
Can we make constructors static?
How big is a 32 bit integer?
What’s the difference between constructors and other methods?
Why static functions are used?
What is space character in java?
How to sort numbers in java without array?