title: Java Online Compiler Issue
body: <p>I am doing an assignment for school on pearson myprogramming lab, which completely sucks by the way, and I am getting no output from my program. However, on netbeans my application is solid, compiling and giving desired output. I've looked through the forums and found a similar problem but the fix suggest did not work for my application.</p>
  
  <p>Here is the assignment:</p>
  
  <p>Design a class named <code>Person</code> with fields for holding a person's name, address and telephone number (all as <code>String</code>s). Write a constructor that initializes all of these values, and mutator and accessor methods for every field.</p>
  
  <p>Next, design a class named <code>Customer</code>, which inherits from the <code>Person</code> class. The <code>Customer</code> class should have a <code>String</code> field for the customer number and a <code>boolean</code> field indicating whether the customer wishes to be on a mailing list. Write a constructor that initializes these values and the appropriate mutator and accessor methods for the class's fields.</p>
  
  <p>Demonstrate the <code>Customer</code> class in a program that prompts the user to enter values for the customer's name, address, phone number and customer number, and then asks the user whether or not the customer wants to receive mail. Use this information to create a customer object and then print its information.</p>
  
  <p>Put all of your classes in the same file. To do this, do not declare them public. 
  Instead, simply write:</p>
  
  <pre><code>class  Person { ... }
  class  Customer { ... } 
  </code></pre>
  
  <p>Upon submission of the code below this is the error I receive:</p>
  
  <pre><code>Driver.java:103: error: class Demo is public, should be declared in a file named Demo.java
       public class  Demo
              ^
  1 error 
  </code></pre>
  
  <p>Code:   </p>
  
  <pre><code>import java.util.Scanner;
  
  class Person
  
  {
  
  private String name;
  private String address;
  private String number;
  
  public Person(String name, String address, String number)
  {
          super();
          this.name = name;
          this.address = address;
          this.number = number;
  }
  
  
      public String getName()
  {
      return name;
  
  }
  
  
  public void setName(String name)
  {
      this.name = name;
  
  }
  
  
  public String getAddress()
  
  {
      return address;
  
  }
  
  public void setAddress(String a)
  
  {
      address = a;
  
  }
  
  
  
  public String getNumber()
  {
      return number;
  
  }
  
  public void setNumber(String number){
   this.number = number;
  }
  
  }
  
  
  class Customer extends Person
  
  {
   private String custNumber;
   private boolean wants;
  
   public Customer(String name, String address, String number, String         custNumber, boolean wants)
   {
    super(name, address, number);
    this.custNumber = custNumber;
    this.wants = wants;
   }
  
   public String getcustNumber()
   {
      return custNumber;
  
   }
  
   public boolean isWants()
   {
      return wants;
   }
  
  
  
   public void setWants(boolean wants)
   {
     this.wants = wants;
   }
  }
  
  /**
   *
   * @author Jonathan
   */
  
    public class  Tester
   {
  
  
     public static void main(String[] args)
     {
          String name, address, number;
          String custNumber;
          String decide;
          boolean wants;
  
          Scanner keyboard = new Scanner(System.in);
  
          System.out.print("Enter name of customer:Enter address of     customer:Enter phone number of customer:Enter yes/no -- does the customer want to recieve mail?:");
  
          name = keyboard.nextLine();
  
          address = keyboard.nextLine();
  
          number = keyboard.nextLine();
  
          custNumber = keyboard.nextLine();
  
          decide = keyboard.nextLine();
                      wants = decide.equals("yes");
  
          Customer one = new Customer(name, address, number, custNumber,     wants); // creates new Customer Object.
          System.out.println("Customer: ");
          System.out.println("Name: " + one.getName());
          System.out.println("Address: " + one.getAddress());
          System.out.println("Phone Number: " + one.getNumber());
          System.out.println("Receive Mail?: " + one.isWants());
  
  
  
  
  
     }
  
   }
  </code></pre>