0

Is possible set. Public static void sayhello()?

23rd Mar 2019, 5:05 PM
Hugo Hector Ramirezz
Hugo Hector Ramirezz - avatar
4 ответов
+ 2
You don't need to set it public. Public means other classes have access. Hope this example helps you: https://code.sololearn.com/cBQmUDJb9N3h/?ref=app
23rd Mar 2019, 7:18 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Can you explain what you mean? Do you mean this? public static void sayHello(String name){ System.out.println("Hello " + name); } sayHello("David"); //Output: "Hello David"
23rd Mar 2019, 6:58 PM
Denise Roßberg
Denise Roßberg - avatar
0
Well i need set public or not?
23rd Mar 2019, 7:02 PM
Hugo Hector Ramirezz
Hugo Hector Ramirezz - avatar
0
Oooo okay So don't matter that method is private when that class is public?
23rd Mar 2019, 7:51 PM
Hugo Hector Ramirezz
Hugo Hector Ramirezz - avatar