以下选项中,( )是错误的标识符。
A: _int
B: a_6b$
C: thread1
D: instanceof
A: _int
B: a_6b$
C: thread1
D: instanceof
举一反三
- 5.1 在(1)~(3)处填上适当的语句,使程序能正常运行。 class MyThread implements Runable { (1) { while(true){System.out.print("hello"); try { (2) //休眠1秒钟 } catch (InterruptedException e) { e.printStackTrace(); } }}} public class Demo{ public static void main(String []s){ MyThread thread1= (3) //声明创建对象thread1 Thread thread = new Thread(thread1,"线程1") thread.start(); //通过对象thread启动线程 }}
- 以下选项中合法的标识符是( )。 A: _for B: int C: 51job D: a-b
- 生成一个[1,6]之间的随机整数,以下选项中,正确的是( )。 A: int a=(int)(Math.random()*6); B: int a=(int)(Math.random()*5); C: int a=(int)(Math.random()*6)+1; D: int a=(int)(Math.random()*5)+1;
- 以下选项中合法的标识符是( )。 A: 2s B: .ob C: _j D: int
- 以下选项中不合法的标识符是( )。 A: -t6 B: INT C: print D: _a9