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.
zat_om
#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.
zat_om
#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.
system
closed
#5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.