+ 1
A method declared with arguments..cannot be executed if it didn't take those arguments ?
2 ответов
+ 3
Yes, but you can overload funcion:
void println(String s) {
System.out.println(s)
}
void println(int t) {
System.out.println(t)
}
void println() {
System.out.println("")
}
Now you can use the same function for String, int and without arguments.
+ 1
thank you :)