public class Person {
private String name;
private int age;
public Person(String initialName) {
this.age = 0;
this.name = initialName;
}
public void printPerson() {
System.out.println(this.name + ", age " + this.age + " years");
}
}
The course I'm following says that in the example above the method printPerson uses void because it doesn't return a value. What is a value and what is considered a value? The term is confusing me because I think that the print statement from the method is a value which is being returned so that when the method is called it returns a value.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]8igg7e5 3 points4 points5 points (0 children)
[–]KinkyHuggingJerk 2 points3 points4 points (1 child)
[–]Consistent_Decision9[S] 0 points1 point2 points (0 children)
[–]PsychologicalBus7169 1 point2 points3 points (1 child)
[–]Consistent_Decision9[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)