1
In other languages, such as javascript, it is allowed to make a function by passing a parameter with a default value, as in the following structure:
function myFunction(value = true){
//alguma ação
}
I tried to do the same with Java, only it’s not allowed.
public void myFunction(Boolean value = true) {
//alguma ação
}
Does anyone know why or if there’s any alternative way?
True, I had not found it before. I will delete the question!
– Hamurabi Araujo
No excludes, duplicates are good for the site. Mainly because your question uses different terms, now if someone looks for what you asked will be able to find the answer in the other question...
– Jéf Bueno