This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Difficult creating basic List method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Difficult creating basic List method" Watch "Difficult creating basic List method" New topic

Difficult creating basic List method

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
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

Joined: Nov 23, 2009
Posts: 234
I realized I need to invoke by the Bean the required atribbutes... hehehe... But keep not working...
Devaka Cooray
ExamLab Creator

Joined: Jul 29, 2008
Posts: 3603

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.

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Difficult creating basic List method
It's not a secret anymore!