For example, imagine I have an object defined like so:
public class Example {
public void doSomething() {
// does something
}
}
If I wanted to call doSomething
, I'd need an instance of Example
:
Example foo = new Example();
foo.doSomething(); // doSomething is executed
My question is, what part of the line foo.doSomething();
is officially considered the method call?
Is it just the doSomething()
part or is it the entire statement including the object (foo.doSomething()
)?