Did you type the command correctly? Make sure it's inside the bark method


#1

class Dog{

int age;
public Dog(int dogsAge)
{
age= dogsAge;
System.out.println(age);

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

}

public static void main(String[] args)

{
Dog s= new Dog(5);

}

}

error-Did you type the command correctly? Make sure it's inside the bark method.


#2

i got it thanks thow!


#3

class Dog {

int age;

public Dog(int dogsAge) {
age = dogsAge;

}

public void bark() {
System.out.printIn("Vroom!");

}

public static void main(String[] args) {

Dog spike = new Dog(5);

}

}

I got error Did you type the command correctly? Make sure it's inside the bark method.


#4

class Dog{

int age;
public Dog(int dogsAge)
{
age= dogsAge;
System.out.println(age);

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

}

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

}
}

Error- how to solve-Did you type the command correctly? Make sure it's inside the bark method.


#5

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