"Constructor have no explicit return type." What does it mean?
As far as I knew that Constructor have no explicit return type. But according to the given example code, why they use return color; ? [The example given] public class Vehicle { private String color; Vehicle() { this.setColor("Red"); } Vehicle(String c) { this.setColor(c); } // Setter public void setColor(String c) { this.color = c; } // Getter public String getColor() { return color; } } public class Program { public static void main(String[] args) { //color will be "Red" Vehicle v1 = new Vehicle(); //color will be "Green" Vehicle v2 = new Vehicle("Green"); System.out.println(v2.getColor()); } } [PS. I am still a highschool and new to Java. Sorry]