• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Overloading methods

 
Ranch Hand
Posts: 42
2
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was reviewing the nuances of overloading methods, and I came across the paragraph in the Oracle docs:

The Java programming language supports overloading methods, and Java can distinguish between methods with different method signatures. This means that methods within a class can have the same name if they have different parameter lists (there are some qualifications to this that will be discussed in the lesson titled "Interfaces and Inheritance").



Last week I read the entire Oracle lesson on Interfaces and Inheritance Interfaces, and I don't remember reading about this. What are the qualifications?
 
Marshal
Posts: 80780
489
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By no means an easy subject. I know that foo(int...) and foo(int[]) are regarded as equivalent to each other, so they are not permissible together. That sounds like a mistake in the Java™ Tutorials, so I shall send you to the Java® Language Specification (=JLS) here. Beware: The JLS is often difficult to read.
 
Brian Jones Jr.
Ranch Hand
Posts: 42
2
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:By no means an easy subject. I know that foo(int...) and foo(int[]) are regarded as equivalent to each other, so they are not permissible together. That sounds like a mistake in the Java™ Tutorials, so I shall send you to the Java® Language Specification (=JLS) here. Beware: The JLS is often difficult to read.



Thanks Ritchie!
 
Campbell Ritchie
Marshal
Posts: 80780
489
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a pleasure
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic