• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Overloading with Varargs

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi frndz



While compiling getting exception as

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method m1(int[]) is ambiguous for the type A

my doubt is according to overloading concept Output must be "BYTE", but why Compilation error..

Thanks in advance
 
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which compiler are you using? If I compile that code with Java 7u11 I get no errors at all, and it also runs just fine, printing BYTE.
 
sr shashidhar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

J2SE 5.0(1.5)
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sr shashidhar wrote:J2SE 5.0(1.5)


Erm...you do understand that J2SE 5.0 entered its end-of-life on April 8, 2008 and hasn't been supported by Sun/Oracle since November 3, 2009?

That's quite apart from any questions about why you're overloading methods with ellipses...

Winston
 
reply
    Bookmark Topic Watch Topic
  • New Topic