[针对考试]请高手们帮忙总结一下
我做了几份认证的模拟卷,觉得有很多内容有套路可寻,但以自己的能力不能全部总结,
首先声明:此次总结针对SUN的JAVA认证考试。
我有以下几个方面还不能完全有把握做对,请大家帮忙总结一下,尽量要简洁明了,解
题时能一看便知。
1. 各种集合
比如:List,Set,Map,SortedSet,ArrayList,HashMap,Vector等,它们时候有序,是否
可包含重复字符,索引是否唯一。
2. 多线程
线程的各种状态,以及能够“引起状态变化”或者“导致异常出现”的方法。
3. Frame,Panel,Button
它们的最常用的几个默认值,最容易考到的几个布局方法。
4. Stream中关于文件操作的部分
InputStream,OutputStream,DataInputStream,DateOutputStream,PrintWriter,
RandomInputStream等,它们之间相互嵌套调用的方法,尤其是对文件的读写,但是不
涉及网络内容。
5. 内部类,匿名类
它们对每个域中的各种modified的变量的访问权限,以及外部类对它的访问权限和方法
6. "is a关系"和"has a关系"
如何有条理的判断每个选项是属于is a还是has a还是别的……
=======================END=====================
上述是我在做了几套模拟卷之后,总结出来的自己的不足之处,如果能够都弄懂,那
通过这个认证就不成问题了,我以对待高考卷的心态来对待它们,希望大家能帮助我
总结一些套路,务必简洁明了,暂时以“通过考试”为原则。哪个朋友如果对上述6
个方面的其中一个或几个方面有比较深入全面的理解,帮忙概括一下,谢谢。
=================================================
另外,以下是我从别处转载的“阴险试题”的常用陷阱,希望对大家有帮助。
有几个行很长,没换行看不到了,大家多按按方向键即可。
.
SCJP考题中的陷阱
原著 Ajith Kallambella
(1) Two public classes in the same file. (illegal)
(2) Main method calling a non-static method. (illegal)
(3) Methods with the same name as the constructor(s). (这种题常有)
(4) Thread initiation with classes that do not have a run() method. (常考之题)
(5) Local inner classes trying to access non-final vars. (illegal)
(6) Case statements with values out of permissible range. (byte,int, short,
chat)
(7) Math class being an option for immutable classes !! (totally wrong!)
(8) instanceOf is not same as instanceof.
(9) Private constructors. (legal)
(10) An assignment statement which looks like a comparison. (比如说if(a=true),对
于这种题眼睛亮一点)
(11) System.exit() in try-catch-finally blocks. (finally 不会执行)
(12) Order of try-catch-finally blocks matters. (若顺序错的话: error: No try
before catch)
(13) main() can be declared final. (OK)
(14) -0.0 == 0.0 is true.
(15) A class without abstract methods can still be declared abstract.
(16) RandomAccessFile descends from Object and implements DataInput and
DataOutput.
(17) Map does not implement Collection.
(18) Dictionary is a class, not an interface.
(19) Collection is an Interface where as Collections is a helper class. (这题我
倒没见过,但还真容易看混)
(20) Class declarations can come in any order.
(也就是说: class Child extends Parents{}
class Parents{}
这种顺序是可以的.)
(21) Forward references to variables gives compiler error.
(22) Multi dimensional arrays can be sparce.
(这句话是说: 多维数组中子数组不一定必须有一定个数的元素,比如我们把一个二维数组看
成一个矩阵,那么行与列中的元素可以不完整,可以不对齐.)
(23) Arrays, whether local or class-level, are always initialized.
(24) Strings are initialized to null, not empty string.
(25) An empty string is NOT the same as a null string.
(26) A declaration cannot be labelled.
(27) "continue" must be in a loop(for, do, while). It cannot appear in case
constructs.
(28) Primitive array types can never be assigned to each other, eventhough the
primitives themselves can be assigned.
(也就是说: ArrayofLongPrimitives = ArrayofIntegerPrimitives 会编译出错,但
longvar = intvar 是合法的)
(29) A constructor can throw any exception.
(30) Initilializer blocks are executed in the order of declaration.
(31) Instance initializer(s) gets executed ONLY IF the objects are constructed.
(32) All comparisons involving NaN and a non-Nan would always result false. (对
大多数朋友来说这可是个盲点噢)
(33) Default type of a numeric literal with a decimal point is double.
(我在这里把Java成员变量默认初始化原则写一下:
成员变量类型 取值
byte 0
short 0
int 0
long 0L
char '\u0000'
float 0.0F
double 0.0D
boolean false
所有引用类型 null )
(34) integer (and long ) operations / and % can throw ArithmeticException while
float / and % will never, even in case of division by zero.
(35) == gives compiler error if the operands are cast-incompatible.
(36) You can never cast objects of sibling classes( sharing the same parent ),
even with an explicit cast.
(37) .equals returns false if the object types are different.It does not raise a
compiler error.
(38) No inner class can have a static member.(but static inner class can)
(39) File class has NO methods to deal with the contents of the file.(also the
existing directory)
(40) InputStream and OutputStream are abstract classes, while DataInput and
DataOutput are interfaces.
问题点数:0、回复次数:3Top
1 楼bigmouse2002(平风造雨*四无君)回复于 2003-11-03 05:00:00 得分 0
1:骗人终骗己!
2:没有艰苦的付出,就不可能有收获!
3:十分耕耘,三分收获,三分耕耘,没有收获!Top
2 楼foxyouyou(小香香)回复于 2003-11-03 10:59:33 得分 0
我是中国教育制度的受害者。是我们这里最好的一所重点高中把我培养成这样的,也只有这样,我们高中在杭州地区的升大学比例最高,被重点大学的录取的人最多。另外,考试就是考试,学习就是学习,是2回事,先要有考试能力,才能有机会进大公司获取更好的机会。我还有总结自己的不足,比起背BIBLE的人来已经好多了。你如果不能回答这些问题,也不要无聊地灌水了。Top
3 楼wdllly(杨开)回复于 2003-11-06 20:06:30 得分 0
总结的不错!
教育制度确实很烂!Top




