8. Methods I


I cannot find anything wrong with my code. Here is my code:

class Dog {
  int age;

	public Dog(int dogsAge) {
  	age = dogsAge;

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




Hi firestarwang,

Hint: We always define methods inside the class and not inside another method. Think about your bark and main methods :wink: