8. Methods I


I can't find anything wrong with my code. Here is it:

class Dog {
  int age;

	public Dog(int dogsAge) {
  	age = dogsAge;

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




Soo in summary you're saying that there's no problem here?


What I meant was that I have a problem, but I can't find it.


If you say that there is a problem but don't explain what the problem is, then there isn't a whole lot to go by.

While others COULD run your code and start guessing what you think is wrong about it, the responsibility of finding out what is wrong is entirely yours. You'll have to ask questions which lead you to finding out how to repair your code.



I believe that you created the bark method in the wrong place.
You have to create the method before the main method.
I hope it helps.


you forgotten semicolon