问题遇到的现象和发生背景
?
#关于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;
}
}