aspose file tools*
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Difficult creating basic List method" Watch "Difficult creating basic List method" New topic
Author

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
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3219
    
  49

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Difficult creating basic List method