8. Methods Can not find Symbol


#1

I am stuck on this exercise and I would appreciate help.

Error: Dog.java:17: error: cannot find symbol
System.out.print1n(“Woof!”);
^
symbol: method print1n(String)
location: variable out of type PrintStream
1 error



//create a custom Dog class
class Dog {
  
  //use instance variables to model our Car class after a real-life Dog

  //the class contructor for the Dog Class
  
  int age;

	public Dog(int dogsAge) {
    
  	age = dogsAge;
    
  }
  
  public void bark() {
		System.out.print1n("Woof!");
  }

	public static void main(String[] args) {
    
    Dog spike = new Dog(5);

	}

}



#2

You are calling System.out.print1n, rather than System.out.println. Check for typos.


#3

I’m sorry, but they both look exactly the same to me.


#4

System.out.print1n is not a valid method call… it has a 1 in it.

System.out.println IS a valid method call.

See the Java documentation for more information.


#5

I don’t even know what that character is. is doesn’t quite look like a “l” neither an i.

Edit: Oh sorry, I guess it is an l, I’m use it looking differently. at the time it looked more like a one than the letter l. Thanks for the help, sorry for being dumb.


#6

What you have in your program is as follows:
System.out.print1n. (The bolded character is a 1, it needs to be an l)


#7

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