• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is this consider a JavaBean?

 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I want to make sure my definition of JavaBean.



I want to point out is the method setVar2(String) valid if classify as JavaBean? Or "must" I use setVar2(int)?
 
Campbell Ritchie
Marshal
Posts: 53135
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure, but I think you need a setVar2(int) method.
 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Campbell, so i assume it's not a javabean.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



One of the rule of Java Beans is the setter argument type must be same as the getter return type.
 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Balu
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!