Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Problem running code with JDK 1.5

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

I haven't fooled around with the JDK 1.5, that much, yet...

Was trying to run this code sample on my G4 PowerBook (running OS X Tiger) and as you can see the Java version on my machine is set as follows:



Here's the code that giving me problems:



When I try to compile this code, this is the warning I get:



What does this all mean?

Many, many, thanks!
 
Marshal
Posts: 67497
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think there's any Mac-specific dimension to this, so I've moved it along to the Java in General (intermediate) forum.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Collections framework has been rewritten to take advantage of generics which are a new feature in Java 1.5 that add some extra type-checking. Notice that the output says these are warnings only, so you can safely ignore them for now and run your program just fine. However, I strongly encourage you to learn more about generics so that you can modify your program to take advantage of this powerful feature.

Layne
 
Unnsse Khan
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you provide me with an example which is pertinent to the code above?
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Unnsse Khan:
Can you provide me with an example which is pertinent to the code above?



A quick search provides many examples already available on the Web, so I won't repeat it here. (Google is your friend!)

Layne
 
Unnsse Khan
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Layne,

I think you misunderstood me... I wasn't trying to get anyone to do the work for me. The reason I asked for an example is because my trusty IDE (Eclipse) placed this before the particular method:

@SuppressWarnings("unchecked")

Thanks for the help...

Kindest regards,
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Unnsse Khan:
Layne,

I think you misunderstood me... I wasn't trying to get anyone to do the work for me. The reason I asked for an example is because my trusty IDE (Eclipse) placed this before the particular method:

@SuppressWarnings("unchecked")

Thanks for the help...

Kindest regards,



I'm not sure what that has to do with examples about generics. Perhaps I misunderstood what you were asking for. This looks like it may be a compiler directive to Eclipse so that it will suppress the warnings that you originally asked about. As far as I know, this line is specific to Eclipse and is not a general Java convention.

Layne
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic