wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Method Overloading Problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Method Overloading Problem..." Watch "Method Overloading Problem..." New topic
Author

Method Overloading Problem...

Ranjith Suranga
Ranch Hand

Joined: Oct 28, 2012
Posts: 84
Hi..

Please look at this..

http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.4.9

When a method is invoked (§15.12), the number of actual arguments (and any explicit type arguments) and the compile-time types of the arguments are used, at compile time, to determine the signature of the method that will be invoked (§15.12.2). If the method that is to be invoked is an instance method, the
actual method to be invoked will be determined at run-time, using dynamic method lookup (§15.12.4).


Can someone please explain these phrases...

01. the number of actual arguments (and any explicit type arguments)

what does it mean by "actual arguments" ?

02. If the method that is to be invoked is an instance method

Does it mean this by "instance method" , == method which is not static, method which belongs to object

Thank you...
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
It means how many arguments are passed. myObject.foo(1, 2, 3, 4); has 4 arguments.
Yes, an instance method is a not‑static one.
Ranjith Suranga
Ranch Hand

Joined: Oct 28, 2012
Posts: 84
Thank you...
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
You’re welcome :
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Method Overloading Problem...
 
Similar Threads
Where method overloading sequence has refereed in JLS ?
Marking an overridden method final
OOPS Concept calling method with String and Object type
Method ambiguity
can "null" be considered as an object?