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
What is static import?
What is the flag in java?
What are methods in java?
What is a finally block? Is there a case when finally will not execute?
What is the difference between heap and stack memory?
What are the topics in core java?
What do you understand by looping in java? Explain the different types of loops.
Can an interface have a constructor?
there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.
What is the difference between private & public & friendly classes?
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
What does pointer mean?
Is array dynamic in java?
Can a class be a super class and a sub-class at the same time? Give example.
If a class is declared without any access modifiers, where can the class be accessed?