title: How do I link to classes together on java
body: <p>I have 2 classes running on one project. One class is an implement and the other is a GUI, now what I want is for the GUI to seek code from the implement class. My program is a module Calculator, a user enters their coursework and exam scores in order to get their result. </p>
  
  <p><strong>GUI CLASS</strong></p>
  
  <pre><code>  import javax.swing.JOptionPane;
  
   class GUI{
  
  
  public static void main(String[] args) {
  
  
          String result1 = JOptionPane.showInputDialog("Enter Coursework Result:");
          String result2 = JOptionPane.showInputDialog("Enter Exam Result:");
  
  
          int num1 = Integer.parseInt(result1);
          int num2 = Integer.parseInt(result2);
          int avg =  (num1 + num2)/2;
  
          String message = "";
  
          if (avg&lt;40)
          message = "Your Test Score:  "+avg+"% Sorry But You Failed!";
  
          else if(avg&lt;=120)
          message = "Your Test Score:  "+avg+"% Well Done, You Passed!";
  
          JOptionPane.showMessageDialog(null, message);
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>IMPLEMENT CLASS</strong></p>
  
  <pre><code>import java.util.Scanner;
  
  public class Calculator {
  
  public static void main (String[] args) {   
  
  Scanner boykie = new Scanner (System.in);
  short result1;
  short result2;
  int avg = 0;
  
  System.out.println("Enter Coursework Result:");
  result1=boykie.nextShort();
  System.out.println("Enter Exam Result:");
  result2=boykie.nextShort();
  
  avg = (result1+result2)/2;
  
  if (avg&lt;40)
      System.out.println("Your Test Score:  "+avg+"% Sorry But You Failed!");
  
  else if(avg&lt;=100)
      System.out.println("Your Test Score:  "+avg+"% Well Done, You Passed!");
  
  
  
  }
  
  }
  </code></pre>