aspose file tools*
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
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: 4340
    
    2

i tried changing

to

but still getting warnings


SCJP
Visit my download page
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3611
    
  14

Hi Randall. Please post the warnings you get.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    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: 4340
    
    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: 3611
    
  14

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: 4340
    
    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: 4340
    
    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