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
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
Is that exactly what the exercise has asked you to print?
it was (“Woof!”); i tried this exactly what quesion is asking … but still the same error . m trying since morning
Try using the restart this exercise option under Get Help.
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
You have printin
, it should be println
ufff… thanks… m trying in and In again and again its Ln -
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.