I found it little cumbersome to understand from the accepted answer so googled few more links and got below answer.
Enterprise JavaBeans (EJB) 3.1 these are J2EE specifications which instructs server (application server) to deploy a piece of code in EJB Container.
EJB technology is the server-side component architecture for the development and deployment of component-based business applications. EJB technology enables rapid and simplified development of distributed, transactional, secure, and portable applications based on Java EE 6 technology.
In simple language:
If you create an EJB and deploy it on server, it can be called remotely (using some technique, i.e. JNDI lookup using RMI) or locally (i.e. with in an application).
On the other hand, Java beans, is a simple plain Java class with getters and setters and that class is serialized, below is the example:
public class MyBean implements java.io.Serializable
{
protected int theValue;
public MyBean()
{
}
public void setMyValue(int newValue)
{
theValue = newValue;
}
public int getMyValue()
{
return theValue;
}
}
So, it means there is no comparison between EJB and Java Beans, both are totally different concept.