A simple Scala JavaBean example

Just a quick note today that if you want to create a JavaBean class in Scala (a Scala JavaBean), you can use the @BeanProperty annotation as shown here:

class Person(@BeanProperty var firstName: String, 
             @BeanProperty var lastName: String, 
             @BeanProperty var age: Int) {
  override def toString: String = return format("%s, %s, %d", firstName, lastName, age)
}

That's a good start, and may work for most Scala JavaBean needs, but in case you need any more information, see my Scala JavaBean and BeanProperty tutorial on the devdaily.com website.

Reporting live from beautiful downtown Boulder, Colorado, this is Alvin Alexander.