Add an instance integer field to the Crab class to count the number of worms eaten and when a worm is eaten: increment its value and check the new value to see if a Lobster needs added, adding it if neccessary.
You need to show some effort. Post some attempted code. You may want to browse the Java tutorials, especially the first two sections on Learning the Java Language.