setters and getters issue
Why is this bringing a runtime error? public class Vehicle { private String color; private int age; //getter for age public int getAge(){ return age; } //setter public void setAge(int age){ this.age = age; } // Getter public String getColor() { return color; } // Setter public void setColor(String c){ this.color = c; } } class Program { public static void main(String[ ] args) { Vehicle v1 = new Vehicle(); v1.setColor("green"); System.out.println(v1.getColor()); Vehicle ae = new Vehicle(); ae.setAge (12); System.out.println("the age is " +ae.getAge); } }