• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

having trouble understanding generics

 
Randall Twede
Ranch Hand
Posts: 4469
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried changing

to

but still getting warnings
 
Stephan van Hulst
Bartender
Pie
Posts: 6114
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Randall. Please post the warnings you get.
 
Randall Twede
Ranch Hand
Posts: 4469
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Oh, you already tried that?

What warnings did you get for that code?
 
Randall Twede
Ranch Hand
Posts: 4469
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 6114
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to clean the project and then recompile it. NetBeans has a 'Clean and Build' option under the 'Run' menu.
 
Randall Twede
Ranch Hand
Posts: 4469
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4469
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that did it. thanks
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic