Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difficult creating basic List method

 
André Asantos
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does not compile? I have created the Bean of nomeAnimalDomestico and nomeAnimalSalvagem I wanted to add names into the list and after return all that...

 
André Asantos
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realized I need to invoke by the Bean the required atribbutes... hehehe... But keep not working...
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4264
229
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
André Asantos wrote:lista.add(this.setNomeAnimalDomestico("Cachorro"));

Return type of setNomeAnimalDomestico method is void - means it doesn't return anything. The above statement attempts to get a return value from setNomeAnimalDomestico method and pass it to lista.add method.

Please CarefullyChooseOneForum when you ask a question
This forum is for posting sun certification results, moving this to the SCJP forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic