Is a static method the same thing as a statically bound method?
-
class A { static method Jump } main { A.Jump } would be a static method but from what i understand a statically bound method is simply one where the call to the method is hard coded in. For example, with polymorphism the methods are dynamically bound if the method call is looked up at run-time because we are dealing with to objects that inherit from the same object. So would the following be an example of a statically bound method: class A {} class A1 : A {} class A2 : A { method Jump } main { A2 a2 = new A2 a2.Jump() } now is that a statically bound method because we know from compile time that .Jump() is referring to the .Jump() in a2??? I need some help.
-
Answer:
Static methods IS bounded statically at compile time, because static methods are not polymorphic. class base { static method; } class derived : base { static method; } Base b = new Derived(); b.method // The method from Base will be called, not from Derived If your example is in C\C++ then the method IS statically bound (because you have to put virtual to enable dynamic binding). However, if your example is in JAVA, then the method is NOT statically bounded (you have to declare it as final to make it statically bounded).
Sean M at Yahoo! Answers Visit the source
Related Q & A:
- How to mock static method call by constructor?Best solution by Stack Overflow
- What is the difference between a static method and class method in Python?Best solution by pythoncentral.io
- How to access a non static method in an abstract class's static method?Best solution by Stack Overflow
- How to get actual return type of a generic static method in Java?Best solution by stackoverflow.com
- How do I add to an array from a static method?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.