Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

A simple java bean!  RSS feed

 
mara thamizhan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi all,
Can anybody write a simple javabean & tell what is the use of reflection,introspection feature of javabean.

cheers!
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is a duplicate thread that you alread posted in the Java In General forum.

Please do not cross post, or duplicate post. The other thread in Java in General is the more appropriate forum for this question anyway. JavaBeans are not EJBs. Which kind of helps a little in answering your question. You have found out what they are not.

Good Luck

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator



I didn't enter the code of the methods because this is all you really need to know to define a JavaBean. It is a pattern, a contract for you to follow. Use Getters and Setters. Encapsulate it by keeping the instance variables private.

Mark
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!