问答详情
源自:3-5 Java中的逻辑运算符

帮忙找下错,加一分,多谢

ublic class HelloWorld {
    public static void main(String[] args) {
        boolean a = true; // a同意
        boolean b = false; // b反对
        boolean c = false; // c反对
        boolean d = true; // d同意
        System.out.plantln((a&&b)+"未通过")
        System.out.plantln((a||d)+"通过")
        System.out.plantln((!a)+"未通过")
        System.out.plantln((c^d)+"通过")
    }
}

提问者:qq_救赎_2 2016-06-19 18:03

个回答

  • 宝慕林7800137
    2016-06-19 18:26:38
    已采纳

    //首先你的输出全部没有分号结束

    //其次,你的输出语句有错误


             boolean a = true; // a同意
             boolean b = false; // b反对
             boolean c = false; // c反对
             boolean d = true; // d同意
             System.out.println((a&&b)+"未通过");
             System.out.println((a||d)+"通过");
             System.out.println((!a)+"未通过");
             System.out.println((c^d)+"通过");


  • 断崖
    2016-06-19 18:28:38

    输出是System.out.println();


  • 慕斯卡7902753
    2016-06-19 18:22:12

    先指出错误,(1)public的p不见了(2)应该是System.out.println(),而不是plantln;(3)输出结尾没有分号;

    然后罗列下改正后的:

    public class HelloWorld {
        public static void main(String[] args) {
            boolean a = true; // a同意
            boolean b = false; // b反对
            boolean c = false; // c反对
            boolean d = true; // d同意
            System.out.println((a&&b)+"未通过");
            System.out.println((a||d)+"通过");
            System.out.println((!a)+"未通过");
            System.out.println((c^d)+"通过");
        }

  • 不要和我讲话我只是路人甲
    2016-06-19 18:20:42

    怎么开头的第一行“public”少了个“p”,是少复制还是忘了?