0

Possible Duplicate:
What is a Java Bean exactly?

This is a simple question about Java Bean, there is some restriction in the type of classe? For example, a bean can be a abstract class ?

Thanks

Community
  • 1
  • 1
Édipo Féderle
  • 3,989
  • 4
  • 28
  • 32

1 Answers1

8

A JavaBean class is a class which respects a number of conventions. But depending on the usage of the class, some conventions are or aren't important. In the strict sense, a JavaBean class

  • must have a public no-arg constructor allowing to instantiate it
  • must have properties available through getters and setters
  • must be serializable

So, in the strict sense, a JavaBean class may not be abstract. But an abstract class can be the superclass of a JavaBean class.

JB Nizet
  • 657,433
  • 87
  • 1,179
  • 1,226