• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem running code with JDK 1.5  RSS feed

 
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
  • 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!
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!