Answers for "convert java Boolean nullable reference to false"

0

java stop convert null to boolean false

public class Produto{
  	private Boolean promocao;
  
	public Boolean isPromocao() {
		if (promocao instanceof Boolean) {
			return promocao;
		} else {
			return null;
		}
	}

	public void setPromocao(Boolean promocao) {
		if (promocao instanceof Boolean) {
			this.promocao = promocao;
		} else {
			return;
		}
	}
}
Posted by: Guest on December-03-2020

Code answers related to "convert java Boolean nullable reference to false"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language