我想要的最终结果就是这个
System.out.println("This is the not equal to sign\n?");
Run Code Online (Sandbox Code Playgroud)
出现(运行时)为
This is the not equal to sign
?
Run Code Online (Sandbox Code Playgroud)
不要出现
This is the not equal to sign
?
Run Code Online (Sandbox Code Playgroud)
有没有办法做到这一点?我尝试使用Windows字符映射,在这里复制符号,并在我的代码中,但在将编码更改为UTF-8并插入后,它出现了?跑步的时候......
可以做些什么?提前感谢这个完全简单的问题的答案
快问.我在程序中有这个代码:
input = JOptionPane.showInputDialog("Enter any word below")
int i = 0;
for (int j = 0; j <= input.length(); j++)
{
System.out.print(input.charAt(i));
System.out.print(" "); //don't ask about this.
i++;
}
Run Code Online (Sandbox Code Playgroud)
i 是一个值为0的整数,如图所示运行代码会产生此错误:
线程"main"中的异常java.lang.StringIndexOutOfBoundsException:字符串索引超出范围: 在program.main的
java.lang.String.charAt(未知源)
处为6 (program.java:15)
如果我charAt int改为0而不是i,它不会产生错误......
可以做什么?问题是什么?