Input function declaration

why is input function declared as private whereas in all previous videos we declared functions as public static.

you can use public here no issue
private keyword is part of oops.(leave for now )
A Java private keyword is an access modifier. It can be assigned to variables, methods, and inner classes. It is the most restricted type of access modifier.

1 Like