This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes having trouble understanding generics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "having trouble understanding generics" Watch "having trouble understanding generics" New topic
Author

having trouble understanding generics

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

i tried changing

to

but still getting warnings


SCJP
Visit my download page
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3892
    
  18

Hi Randall. Please post the warnings you get.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

found raw type: JComboBox
private JComboBox<String> = new JComboBox(choices);

missing type argument for generic class JComboBox<E>

unchecked call to JComboBox(E[])

unchecked conversion
private JComboBox<String> = new JComboBox(choices);
required JComboBox<String>
found JComboBox
3 warnings
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6



Oh, you already tried that?

What warnings did you get for that code?
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

i still don't get it

the warnings are for the second code. i think the warnings for the original code were similar
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3892
    
  18

Try to clean the project and then recompile it. NetBeans has a 'Clean and Build' option under the 'Run' menu.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

i think i know what you mean. since i am using Command Prompt i will delete all class files and recompile
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

that did it. thanks
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Randall Twede wrote:i think i know what you mean. since i am using Command Prompt i will delete all class files and recompile


Good call. And then, SSCCE, complete with copy/paste of exact error message, or it didn't happen.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: having trouble understanding generics
 
It's not a secret anymore!