Stilll getting same error


#1

class Dog{

int age;
public Dog(int dogsAge)
{
age= dogsAge;

}

public void bark()
{
System.out.println("WOOF!");

}

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

}
}

stilll getting same error


8.Methods:I Help?
#2

Is that exactly what the exercise has asked you to print?


#3

it was ("Woof!"); i tried this exactly what quesion is asking .. but still the same error . m trying since morning


#4

Try using the restart this exercise option under Get Help.


#5

class Dog {

int age;

public Dog(int dogsAge) {
age = dogsAge;

}

public void bark() {
System.out.printin("Woof!");
}

public static void main(String[] args) {

Dog spike = new Dog(5);

}

}

restart the exercise again having the same problem

At RHS error
Dog.java:12: error: cannot find symbol
System.out.printin("Woof!");
^
symbol: method printin(String)
location: variable out of type PrintStream
1 error


#6

You have printin, it should be println


#7

ufff... thanks.. m trying in and In again and again :smiley: its Ln -


#8

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