1.
可变参数的使用规则:
1.最后一个参数,前不能由非可变参数
2.如果有同名的非可变参数函数,优先匹配
3.如果有两个可以匹配的可变参数函数,错误
2.
static final int[] a = { 100,200 };
B.static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }
C.static final int[] a = new int[2]{ 100,200 };
D.static final int[] a;
static void init() { a = new int[3]; a[0]=100; a[1]=200; }
只有A B合法
3.
同名变量就近原则
4.
run()方法:在本线程内调用该Runnable对象的run()方法,可以重复多次调用;
start()方法:启动一个线程,调用该Runnable对象的run()方法,不能多次启动一个线程;
5.
short 和Short是不同的
6.
Locale.setDefault(new Locale("fr", "FRANCE", "MAC"));The method setLocale(Locale) is undefined for the type DateFormat
7.
Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object? (Choosetwo.)
A. When using versions of Java technology earlier than 5.0.
B. When sharing a StringBuffer among multiple threads.
C. When using the java.io class StringBufferInputStream.
D. When you plan to reuse the StringBuffer to build more than one string.
Answer: AB
Section: All
8.
Console中readpassword返回的是char[]而不是string
9.
\s必须使用转义\
10.
全局变量: return(i++); <==> return i ; i=i+1;
局部变量: return(i++); <==> return i ; //应该没有i=i+1这个动作发生了