Question
What is the difference between static and instance methods

Answers

Instance method belongs to the instance of a class therefore it requires an instance before it can be invoked, whereas static method belongs to the class itself and not to any class instance so it doesn’t need an instance to be invoked. Instance methods use dynamic (late) binding, whereas static methods use static (early) binding. When the JVM invokes a class instance method, it selects the method to invoke based on the type of the object reference, which is always known at run-time. On the other hand, when the JVM invokes a static method, it selects the method to invoke based on the actual class of the object, which may only be known at compile time.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Kind of refrigerant use in a refrigerating system
  • Q diffusion of light in the atmosphere takes place due to:
  • Q ‘The General happiness is the end of the state’; who said this?
  • Q Is it possible to change the index of primary key on table?
  • Q What is the ORDER for white-tail deer?
  • Q What do you mean by constructor?
  • Q Which work is known as ‘the Bible of modern Democracy’?
  • Q Give Rule 6 for the use of Capitals?
  • Q Who uses accounting? Is financial accounting necessary?
  • Q What is urea cycle
  • Q What are the pros and cons of cashless economy?