Java OOP - 11. Using Methods II


Everytime I run my code, I keep getting an error saying "Did you type the command correctly?" for "System.out.println(spikeAge);" in the main class. Is this a problem with the website, or am I doing something wrong?

class Dog {

  int age;
	public Dog(int dogsAge){
    age = dogsAge;
  public void bark(){
  public void run(int feet){
    System.out.println("Your dog ran " + feet + " feet!");
  public int getAge(){
    return age;

	public static void main(String[] args) {
    Dog spike = new Dog(4);
    int spikeAge = spike.getAge();



Having the same issue, not able to progress


There are a whole bunch of regexes in the checkpoints in the java track, pretty poor design if you ask me.

This is the regex that you need to match:


regex crash course (enough to read the above anyway)
\s is whitespace
* means zero or more matches of the thing that comes before it
\. is just a dot/period

Here's a useful site for testing if your text matches a regex pattern:


Is there anyway I can fix this?


Is there anyway I can fix this error?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.