title: Q: Player(class) java
body: <p>Have to code a player class in java eclipse following these requirements</p>
  
  <p>a) The Player class should have a default constructor and two custom constructors - one
  that accepts a Name object, and another that accepts both a Name and PairOfDice object.</p>
  
  <p>b) There should be get and set methods for its Name and a get method for PairOfDice. It
  should have a method called rollDice and getDiceScore that both simply delegate to the
  PairOfDice class, which already has this functionality. You should also have an
  appropriate toString() method.</p>
  
  <p>c) Add a further void method setFullPlayerName(String) that accepts a single String
  argument (e.g. “Joe Bloggs”) and then uses this to set the first and family name
  individually by extracting the relevant information and then calling the respective setter
  methods of the Name class.</p>
  
  <p>So far I have this</p>
  
  <hr>
  
  <pre class="lang-java prettyprint-override"><code>public class Player {
  
      //Fields of  the app
      private String firstName;
      private String lastName;
      private Die red;
      private Die blue;
  
      //PlayerName and dice pair Default Constructor
      public Player() {
          firstName = "";
          lastName = "";
          red = new Die();
          blue = new Die();
      }
  
      public Player(String firstName, String lastName) {
          this.firstName = firstName;
          this.lastName = lastName;
      }
  
      public Player(String firstName, String lastName,Die red,Die blue) {
          this.firstName = firstName;
          this.lastName = lastName;
          this.red = red;
          this.blue = blue;
      }
  
      // Methods
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
      public void setlastName(String lastName) {
          this.lastName = lastName;
      }
  
      public String getFirstName() {
          return firstName;
      }
  
      public String getlastName() {
          return lastName;
      }
  
      @Override
      public String toString() {
          return "PairOfDice:[red=" + red + ", blue=" + blue + "]";
      }
  
  
      public void rollDice() {
          red.roll();
          blue.roll();
      }
  
      public int getDiceScore() {
          return red.getScore() + blue.getScore();
      }
  
      public Die getRed() {
          return red;
      }
  
      public Die getBlue() {
          return blue;
      }
  
      public String setFullName() {
          if (firstName.equals("") &amp;&amp; lastName.equals("")) {
              return "";
          } else {
              return firstName + " " + lastName;
          }
      }
  }
  </code></pre>
  
  <p>Is my code correct? if not what changes do i have to make to correct it</p>