How do I run two java files/classes in command prompt if I do not have a package. I will post my two java files below. I have tried javac…

How do I run two java files/classes in command prompt if I do not have a package. I will post my two java files below. I have tried

javac HeadPhone.java && TestHeadPhone.java but it doesnt work

I also tried

Java -cp . HeadPhone && TestHeadPhone

HOW DO I RUN THIS PROGRAM with no IDE please help! 🙁

 public class HeadPhone {

//Three constants named LOW, MEDIUM and HIGH with values of 1, 2 and 3 to denote theheadphone volume.

  public static final int LOW = 1;

  public static final int MEDIUM = 2;

  public static final int HIGH = 3;

// A private int data field named volume that specifies the volume of the headphone. The default volume is MEDIUM.

  private int volume;

// A private boolean data field named pluggedIn that specifies if the headphone is pluggedin. The default value if false.

  private boolean pluggedIn;

// A private String data field named manufacturer that specifies the name of themanufacturer of the headphones.

  private String manufacturer;

// A private Color data field named headPhoneColor that specifies the color of the headphones.

  private String headPhoneColor;

// no argument constructor that creates a default headphone.

  HeadPhone(){

    volume = MEDIUM;

    pluggedIn = false;

    manufacturer = “DEFAULT”;

    headPhoneColor = “DEFAULT”;

  }

//  setter method for Volume

  public void setVolume(int v){

    if(v < LOW){

      volume = LOW;

    }

    else if(v > HIGH){

      volume = HIGH;

    }

    else{

      volume = v;

    }

  }

//  setter method for PluggedIn

  public void setPluggedIn(boolean p){

    pluggedIn = p;

  }

//  setter method for Manufacturer

  public void setManufacturer(String m){

    manufacturer = m;

  }

//  setter method for Color

  public void setColor(String C){

    headPhoneColor = C;

  }

//  getter method for Volume

  public int getVolume(){

    return volume;

  }

//  getter method for PluggedIn

  public boolean getPluggedIn(){

    return this.pluggedIn;

  }

//  getter method for Manufacturer

  public String getManufacturer(){

    return this.manufacturer;

  }

//  getter method for Color

  public String getColor(){

    return this.headPhoneColor;

  }

//A method changeVolume(value) that changes the volume of the headphone tothe value passed into the method

  public void changeVolume(int volume){

    setVolume(volume);

  }

//method named toString() that returns a string describing the current field values of the headphones.

  public String toString(){

    return String.format(“Volume: %dnPlugged In: %bnManufacturer: %snColor: %s”,

        volume, pluggedIn, manufacturer, headPhoneColor);

  }

}

public class TestHeadPhone {

//Three constants named LOW, MEDIUM and HIGH with values of 1, 2 and 3 to denote theheadphone volume.

  public static final int LOW = 1;

  public static final int MEDIUM = 2;

  public static final int HIGH = 3;

// main method to run the program

  public static void main(String args[]){

    //3 HeadPhone objects

    HeadPhones H1 = new HeadPhones();

    H1.setVolume(MEDIUM);

    H1.setManufacturer(“BEATS”);

    H1.setColor(“Red”);

    H1.setPluggedIn(true);

    H1.changeVolume(MEDIUM);

    System.out.println(H1+”nn”);

    HeadPhones H2 = new HeadPhones();

    H2.setVolume(HIGH);

    H2.setManufacturer(“SONY”);

    H2.setColor(“PINK”);

    H2.setPluggedIn(true);

    H2.changeVolume(LOW);

    System.out.println(H2+”nn”);

    HeadPhones H3 = new HeadPhones();

    H3.setVolume(MEDIUM);

    H3.setManufacturer(“JBL”);

    H3.setColor(“BLACK”);

    H3.setPluggedIn(false);

    H3.changeVolume(LOW);

    System.out.println(H3+”nn”);

  }

}







Calculate Your Essay Price
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 10% with the coupon code: best10

Academic Pros