/** * A philosopher who thinks and eats with two forks, * picking up the right fork first. * * @author Franck van Breugel */ public class RightHandedPhilosopher extends Philosopher { /** * Initialize this philosopher with the given id and table. * * @param id the id of this philosopher. * @param table the table of this philosopher. */ public RightHandedPhilosopher(int id, Table table) { super(id, table); } /** * Life of this philosopher. */ public void run() { while (true) { // think super.table.pickUp(super.id); super.table.pickUp(super.id + 1); // eat super.table.putDown(super.id); super.table.putDown(super.id + 1); } } }