「已注销」 2022-07-28 15:38 采纳率: 100%
浏览 24
已结题

#关于Java的问题#这代码出什么错了

问题遇到的现象和发生背景

?
#关于Java的问题#这代码出什么错了

问题相关代码,请勿粘贴截图

import java.util.Scanner;

import static java.lang.System.exit;
import static java.lang.System.out;

//
// A program made with a lot of notes
//

/**
 * @author 肖景诚
 * <p>
 * @version 2.0.98
 */

public class  Dev

{

    /**
     * Main.
     *
     * @param args the args
     *
     */

    public static void main(String[]args)throws RuntimeException

    {

        if (New.returnTrue()&&retTrue())

        {

            try (Scanner in = new Scanner(System.in))

            {

                String a;

                int did = 0;

                java:

                do

                {

                    assert did >= 0 : "a Error";

                    try

                    {


                        if (!retTrue())

                        {

                            did = -1;

                        }

                        else

                        {

                            out.print("<<<");

                            a = in.nextLine();

                            assert a.length() >= (9 + did);

                            if (a.endsWith("\")") && a.startsWith("print(\"") && (a.length() >= 9 + did - 1)&&(!(a.endsWith("\\n\")"))))

                            {

                                out.println(">>>" + a.substring(7, a.length() - 2));

                            }

                           else if (a.endsWith("\")") && a.startsWith("print(\"") && (a.length() >= 9 + did - 1)&&a.endsWith("\\n\")"))

                           {

                                out.println(">>>" + a.substring(7, a.length() - 4)+"\n");

                           }

                           else if ("exit".equalsIgnoreCase(a))

                           {

                                break java;

                           }

                           else if ("help".equalsIgnoreCase(a))

                           {

                                out.println("Welcome to the Dev-java Advanced Compiler. \n1. Use print(\"\") to output English\n2. Use exit to terminate the compilation process\n3. Get help with help\n4.Don't use the error code!It will throw Exception");

                           }

                           else

                           {

                                PrintError.PrintErrors();

                           }

                        }

                    } catch (RuntimeException e)

                    {

                        PrintError.PrintErrors();

                        printlog.printlogs(e.getMessage());

                    }

                }

                while (true);

            }

            out.println("RunBack");

            exit(0);

        }

    }

    /**
     * Ret true boolean.
     *
     * @return the boolean
     *
     */

    public static boolean retTrue(){

        return true;

    }

}

  • 写回答

1条回答 默认 最新

  • Code Writers 全栈领域新星创作者 2022-07-28 15:41
    关注

    mei'chu'cuo

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 8月5日
  • 已采纳回答 7月28日
  • 创建了问题 7月28日

悬赏问题

  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化