0
Is possible set. Public static void sayhello()?
4 Respostas
+ 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
+ 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"
0
Well i need set public or not?
0
Oooo okay
So don't matter that method is private when that class is public?