title: New to coding and getters and setters are not working to a new class?
body: <p>So I have been writing a code for a lab in which we need to create a class titled payroll where we have the getters and setters for name, address, pay and hours worked and then create a method to print the address and the name and another method to calculate hours worked x pay and print that with address and name on another class titled demoPayroll. My getters and setters arent transferring over to the demoPayroll though. This is the code I have. Any help is greatly appreciated!</p>
  
  <pre><code>import java.util.Scanner;
  
  public class DemoPayroll {
  
      public static void main(String[] args) {
          Payroll newEmpInfoObject = new Payroll();
  
          System.out.println("Enter name");
          Scanner keyboard = new Scanner(System.in);
          String name = keyboard.nextLine();
          System.out.println("Enter Address");
          String address = keyboard.nextLine();
          System.out.println("Enter Hourly Pay");
          double payrate = keyboard.nextDouble();
          System.out.println("Enter Hours Worked");
          double hours = keyboard.nextDouble();
  
          newEmpInfoObject.printEmpInfo();
          newEmpInfoObject.getGrossPayEarned();
      }
  }
  
  public class Payroll {
      private String name;
      private String address;
      private double payrate;
      private double hours;
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getAddress() {
          return address;
      }
  
      public void setAddress(String address) {
          this.address = address;
      }
  
      public double getPayrate() {
          return payrate;
      }
  
      public void setPayrate(double payrate) {
          this.payrate = payrate;
      }
  
      public double getHours() {
          return hours;
      }
  
      public void setHours(double hours) {
          this.hours = hours;
      }
  
      public Object printEmpInfo() {
          System.out.println(name);
          System.out.println(address);
          return address;
      }
  }
  </code></pre>