A. cd B. de C. d D. e
A. 9 B. 5 C. 6 D. 6.1
A. String s = "itcast"; B. String s = new String("itcast"); C. String s = new String(new char[] {'i','t','c','a','s','t'}); D. String s = new String(new int[]{1,2,3});
A. String str = "abc"; B. String str = new String(); C. String str = new String("abc"); D. char[] chs = {'a','b','c'};
A. 字符串缓冲区,提高字符串的操作效率 B. StringBuffer类是线程安全的 C. StringBuffer类的toString()方法用于返回缓冲区中的字符串 D. StringBuffer是不可变的对象
A. append()方法可以接受任意类型的数据 B. insert()方法可以接受任意类型的数据 C. append()方法返回的是一个新的StringBuffer对象 D. insert()方法返回的是一个新的StringBuffer对象
A. String类表示的字符串是常量,一旦创建后,内容和长度都是无法改变的。而StringBuffer表示字符容器,其内容和长度都可以随时修改 B. String类覆盖了Object类的equals()方法,而StringBuffer类没有覆盖Object类的equals()方法 C. String类对象可以用操作符"+"进行连接,而StringBuffer类对象之间不能 D. String类覆盖了Object类的toString()方法,而StringBuffer类没有覆盖Object类的toString()方法
A. Math类中所有的方法都是静态的,所以类名.调用即可 B. Math类的构造函数是私有的,所以其他类不能用Math类创建对象 C. Math类在java.math包中 D. Math类可以创建对象
A. 每一个Java应用程序运行时都产生一个Runtime类实例 B. Runtime实例可以将应用程序和运行环境相结合 C. Runtime类没有构造函数 D. Runtime实例不需要创建,直接通过getRuntime()方法获取
A. next(int bits) B. nextInt() C. nextLong() D. random()