public class Bunch { // Field private float m_charge; private String m_type; // Constructors public Bunch(float charge,String type) { m_charge = charge; m_type = type; } public Bunch(String type) { this(1F,type); } // Methods public String type( ) { return m_type; } public float charge(){ return m_charge; } public Bunch merge(Bunch otherBunch) { float newCharge = m_charge + otherBunch.m_charge; String newType ; if(m_type==otherBunch.m_type){ newType= m_type; }else{ newType="mixed"; } Bunch newBunch = new Bunch(newCharge,newType); return newBunch; } }