永发信息网

Read and write "T" for true and "F" for false

答案:3  悬赏:40  手机版
解决时间 2021-03-10 19:01
  • 提问者网友:我的未来我做主
  • 2021-03-09 23:01
Read and write "T" for true and "F" for false
最佳答案
  • 五星知识达人网友:雾月
  • 2021-03-09 23:30
what do you mean?
Could you please describe the question chearly?
全部回答
  • 1楼网友:空山清雨
  • 2021-03-10 01:14
public static boolean isTrue(String str) throws Exception {
if (str.equals("T")) {
return true;
} else if (str.equals("F")) {
return false;
} else {
throw new Exception("不支持!");
}
}
  • 2楼网友:梦中风几里
  • 2021-03-10 00:19
public boolean read() throws Exception{
char c=(char)System.in.read();
if(c=='T') return true;
else return false;
}
public void write(boolean b){
if(b) System.out.println("T");
else System.out.println("F");
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯