1
我已经阅读了一些棘手的面试问题,我看过这个我不明白这背后的逻辑是什么。有人可以解释一下吗?这是如何工作的逻辑是什么?
public class Test
{
public static void main(String[] args) {
for(char ch = 0; ch < Character.MAX_VALUE; ch++)
if (Character.isJavaIdentifierPart(ch) && !Character.isJavaIdentifierStart(ch))
System.out.printf("%04x <%s>%n", (int) ch, "" + ch);
}
}
输出
0000 < >
0001 <>
0002 <>
0003 <>
0004 <>
0005 <>
0006 <>
0007 <>
0008 <>
000e <>
000f <>
0010 <>
0011 <>
0012 <>
0013 <>
0014 <>
0015 <>
0016 <>
0017 <>
....more rows
我会首先发布一个可编译的例子;这甚至不是代码。看起来应该是一个字符串中的东西,但即使如此,仍然缺少某些东西。 –
感谢您的回复。这是它的程序。 – anonymous
我建议你检查正在使用的方法的java文档,然后它应该是有道理的。 –