How do I make a method that does not require an objects, but if there is one it would use it!
Like this
void cls(String source){
if(source.isEmpty()){
source = "Unknown source";
}
output.setText("Screen cleared from " + source);
}
And later when I call this I could do
cls();
but it throws an error because it needs a string
cls("string");
but I want for both to work!