Some of my notes from Java training. Some may be of interests to you.
Java final attribute - A blank final attribute must be set in every constructor. Otherwise compiler reports error. -- Legal -- private final int customerId; public Blank(){ customerId=2; }
Overridden method in child class may throw fewer or no exceptions than the exception in parent class
To create an unchecked exception class, extend your exception class from RuntimeException. For checked exception, extend from Exception.
Do not use assertion to check the parameters of a public method.
To enable assertions, use ea or enableassertions control flag in java command java -ea MyApp java -enableassertions MyApp
Java Arrays are objects and cannot grow in size after you declare
Generics eliminate the need for cast
Primitives cannot be stored in EJB component environment.
Which methods are invoked to transition an entity bean from a state of non-existence to a pooled state 1.The EJB Constructor 2.setEntityContext(EntityContext ec)
Only stateless session beans can be implemented as webservice
Instance variables must be explicitly initialized before you use. Otherwise it is a compile error
In subclasses constructors are never inherited. But you can override them.
POJO vs JavaBeans – JavaBeans mandate no argument constructor and getter/setters.
Difference between Message Driven Beans and others
MDB has only bean class
Clients do not access MDB through interface
Most part MDB's are stateless session beans
onMessage is the method called by container for MDB
Mainly used with JMS for async messaging.
EJB
Remote Interface declare business methods
Home Interface declares EJB lifecycle ejbCreate and ejbRemove