Your First Cup: An Introduction to the Java EE Platform

ProcedureGetting the Age Difference From the DukesBirthdayBean Enterprise Bean

During this task, you will add code to the getAgeDiff method to get the difference in age between the user's age and Duke's age from the EJB and to set the absAgeDiff variable to the absolute value of the age difference.

  1. Inside the getAgeDiff method, directly before the return statement, add the following code:


    ageDiff = dukesBirthday.getAgeDifference(yourBD);
    setAbsAgeDiff(Math.abs(ageDiff));
  2. Right-click in the editor window and select Format.

  3. Select File -> Save.