[英]bootlean returns true or false how to compare the result?
How can I compare the bootlean to a string? 如何将bootlean与字符串进行比较? I have tried to change the bootlean to a string output but I can't because of the checkemail function calls for a bootlean.
我试图将bootlean更改为字符串输出,但由于checkemail函数要求使用bootlean而无法这样做。
The check email states that if its a valid email...which returns "true" or "false". 检查电子邮件指出,如果它是有效的电子邮件...,则返回“ true”或“ false”。
boolean sefsd = checkemails(e.getText().toString());
if(sefsd.toString().equals("false")){ //do something}
if (!sefsd) {
// sefsd == false
}
Article about if statement. 关于if语句的文章。
Try to learn Java before Android programming. 尝试在进行Android编程之前先学习Java。
如果checkmails
返回boolean
类型,则执行
if (sefsd == false) { /*do something */ }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.