aspose file tools
The moose likes Beginning Java and the fly likes having trouble understanding generics Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 4089
i tried changing

to

but still getting warnings


SCJP
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3044
    
    1

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

Joined: Oct 21, 2000
Posts: 4089
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: 5780
    
    5



Oh, you already tried that?

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

Joined: Oct 21, 2000
Posts: 4089
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: 3044
    
    1

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: 4089
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: 4089
that did it. thanks
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 5780
    
    5

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
 
Similar Threads
JTABLE PROBLEM
Java noob needs help
Problem While using EL
Getting [unchecked] error when compiling using sdk
getSelectedItem() selects nothing