• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Array to List conversion

 
Ranch Hand
Posts: 31
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi!

Does anybody knows why I get this error?





Lalala.java:9: error: cannot find symbol
               List<Integer> list = Arrays.asList(arr);
                                          ^
 symbol:   method asList(Integer[])
 location: class Arrays
.\Arrays.java:41: error: incompatible types: possible lossy conversion from int to byte
               System.out.println(switchTest(80));
                                             ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors



Thanks!

 
Bartender
Posts: 15737
368
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a class named Arrays in the same package as your Lalala class? It's hiding java.util.Arrays.
 
Tomas Castagnino
Ranch Hand
Posts: 31
3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Do you have a class named Arrays in the same package as your Lalala class? It's hiding java.util.Arrays.





Thanks a lot!  

Why on Earth I named "Arrays" one of my testing classes?  
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic