import java.io.*;
import java.lang.*;public class a
{
public static void main(String args[])throws Exception
{
BufferedReader bf4 = new BufferedReader(new InputStreamReader(System.in));
String choix=bf4.readLine();
System.out.println(a(choix));
} static Boolean a(String choix)
{
if(choix != null)
{
return ?????;
}
return ?????;
}
}我想让方法a()返回一个boolean的值,方便以后我的&&操作,但是我不知道在问号处应该写入什么,望各位大虾帮助,不胜感谢!
import java.lang.*;public class a
{
public static void main(String args[])throws Exception
{
BufferedReader bf4 = new BufferedReader(new InputStreamReader(System.in));
String choix=bf4.readLine();
System.out.println(a(choix));
} static Boolean a(String choix)
{
if(choix != null)
{
return ?????;
}
return ?????;
}
}我想让方法a()返回一个boolean的值,方便以后我的&&操作,但是我不知道在问号处应该写入什么,望各位大虾帮助,不胜感谢!
if(choix != null)
{
return ;
} else {
syso("請輸入一個值")
}
{
if(choix != null)
{
return true
}
return false
}
} 另一种情况:
static Boolean a(String choix)
{
if(choix != null)
{
return false
}
return true
}
}至于要用哪一种, 这个得看你的程序逻辑来定.