• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use setter/getter in array?  RSS feed

 
K Kci
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is my code correct?

public void setFan(Fan[] aFan) {
fan=aFan;
}

public array getFan() {
return fan;
}
 
John Reidy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct apart from the fact that in Java you cant declare 'Array fan[]' it would be as below:


 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please provide a sample working code so that we can identify how the methods are being accessed and help you to understand things better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!