Program run...but not going to next exercise.In object oriented method 2


#1



Replace this line with your code.


#2

maybe you did some mistake.please post your code with the lesson link


#3

class Dog {

int age;

public Dog(int dogsAge) {
age = dogsAge;

}

public void bark() {

System.out.println("Woof!");

}

public void run(int feet) {

System.out.println("Your dog ran " + feet + " feet!");

}

public static void main(String[] args) {

Dog spike = new Dog(5);
spike.bark();
spike.run(40);

#4

it is showing that insert run method between bark and main method.I have done it.It used to print value but not moving to next exercise.


#5

did you do step by step?
first complete instruction 1 then go for instruction 2

Don't do all at once


#6

thnku..i have completed it now.


#7

most welcome.......... :slight_smile:


#8

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