What is difference between static method and static
variable?

Answer Posted / n.siddardh

static variable copy is available to every object in the
memory if we change one value in an object there no effect
inother objects,and if we declare a method as static that
will be executed by the JVM like main method
The execution of JVM
1.static block
2.static methods
3.Instance methods

Is This Answer Correct ?    7 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is singleton class immutable?

736


Why are pointers not secure?

798


How to display arraylist values in java?

739


What are wrapper classes in java?

816


Which sorting is used in arrays sort in java?

885


What is the difference between a choice and a list?

851


If an application has multiple classes in it, is it okay to have a main method in more than one class?

773


Difference between string s= new string (); and string s = "abv";?

996


Can you use abstract and final both with a method?

829


Explain different ways of creating a thread. Which one would you prefer and why?

814


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

782


What is a pointer and does java support pointers?

794


How do you ensure that n threads can access n resources without deadlock?

1095


what is the purpose of the runtime class?

807


What is the difference between java applets and applications?

861