title: IntelliJ says that it cannot resolve the getValue()
body: <p>So we have a project where we're supposed to make a simple "computer", in that computer we have a memory with addresses that points to different kinds of words. </p>
  
  <pre><code>public interface Word extends Operable {
      Word add(Word word1, Word word2);
      Word mul(Word word1, Word word2);
  }
  </code></pre>
  
  <p>We're then supposed to be able to operate on these words, two of those operations are add and mul. The Word interface is then implemented in the various word subclasses.</p>
  
  <pre><code>public class ByteWord implements Word {
      private Byte value;
  
      public ByteWord(String stringValue) {
          this.value = Byte.parseByte(stringValue);
      }
  
      @java.lang.Override
      public ByteWord add(Word word1, Word word2) {
          this.value = word1.getValue() + word2.getValue();
          return this;
      }
  
      @java.lang.Override
      public ByteWord mul(Word word1, Word word2) {
          this.value = word1.getValue() * word2.getValue();
          return this;
      }
  
      private Byte getValue() {
          return value;
      }
  } 
  </code></pre>
  
  <p>The problem here is that IntelliJ says that it cannot resolve the getValue() and another warning that says that getValue() is never used. </p>
  
  <p>Changing the type of word1 and word2 to ByteWord will solve this problem but give another error saying we're not actually adding in the unimplemented method from Word. </p>
  
  <p>And casting them to the correct wordtype where we're assigning the value to this.value since we know that we will always send in a certain type will say that Java expected byte buy got int from adding two bytes together.</p>
  
  <p>Would love any type of input that might solve my problem here, thanks in advance!</p>