Following is an example of stateful session bean. @Stateful is used to indicate that the bean is a stateful sesion bean.

Java Code:
@Stateful
public class TestBean{
    private int var;
    public int method(){}
    @PreDestroy testMethod(){}
}