Why it is giving me error for getName() and getAge() method like"identifier expected" and "invalid method declaration". My Code is as: public class Dog { //write your code here String name; int age; Public String getName() { return name; } public void setName(String name) { this.name = name; } Public int getAge() { return age; } public void setAge(int age) { this.age = age; } public static void main(String[] args) { Dog dog1 = new Dog(); //Dog dog2 = new Dog(); dog1.getName(); dog1.setName("doggy"); dog1.getAge(); dog1.setAge(23); } }