• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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!

 
Saloon Keeper
Posts: 15453
363
  • 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?  
 
reply
    Bookmark Topic Watch Topic
  • New Topic