「已注销」 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日

悬赏问题

  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000