Java Java Objects Meet Objects Constructors

Brian Madden
Brian Madden
474 Points

[SOLVED] bash: Example: command not found error message

I keep getting the following error message listed in the title when trying to compile the following constructor codes. Would i be able to get some insight? my codes are listed below for each file.

here is my example.java code:

public class Example {

  public static void main(String[] args) {
    // Your amazing code goes here...
    System.out.println("We are making a new PEZ Dispenser");
    PezDispenser dispenser = new PezDispenser("Donatello");
    System.out.printf("The dispenser is %s %n", 
                      dispenser.getCharacterName()
                     );
  }

}

here is my PezDispenser.java code:

class PezDispenser {

  private String characterName;

  public PezDispenser(String characterName) 
  {
    this.characterName = characterName;
  }

  //String.contains
  // public boolean contains(String matchingText)

  public String getCharacterName() 
  {
    return characterName;
  }

}
Brian Madden
Brian Madden
474 Points

solved my own problem fellas. Dyslexia decided to kick in haha. when running the program i did clear && javac Example.java && Example java instead of clear && javac Example.java && java Example