Can I write Bean without having get or set method ? If no whether it will give me run time error or compile time error ??? Pls help me out !!! Thanks....
Joined: Aug 04, 2004
Of course you could have a bean without set and get methods. Bean is a Java class and there is no rule about get and set. But if will not have the get and set method than how will you change the bean value? With public fields?
SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Joined: Jan 29, 2003
The definition of JavaBean includes getters & setters for variables and a no-parameter constructor. If you leave those things out, it's not a JavaBean. It might still be perfectly useful, but it won't play in frameworks that expect JavaBeans that conform to the definition. Zat help?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi