Sun认证Java程序员(SCJP)考题常见陷阱集合
(1) Two public classes in the same file. (illegal)
同一个文件里有两个public类。(非法)
(2) Main method calling a non-static method. (illegal)
在main(String[] args)方法内调用一个非静态方法。(非法)
(3) Methods with the same name as the constructor(s). (这种题常有)
与Constructor(s)有相同名字的'方法。
(4) Thread initiation with classes that do not have a run() method.
初始化了一个没有run()方法的线程类。
(5) Local inner classes trying to access non-final vars. (illegal)
内部类尝试访问非final变量(非法)
(6) Case statements with values out of permissible range. (byte,int, short,chat)
选择语句case中,没有使用允许的值。如(byte、int、short、char)等
(7) Math class being an option for immutable classes !! (totally wrong!)
Math类作为不可改变类。(完全错误)
(8) instanceOf is not same as instanceof.
instanceOf不是instanceof。
(9) Private constructors. (legal)
私有的Constructor。(合法)
(10)An assignment statement which looks like a comparison.
一个赋值语句看起来像比较语句。
比如说if(a=true),和if(a==true)。对于这种题眼睛亮一点。
(11)() in try-catch-finally blocks. (finally不会执行)
在try-catch-final块中的退出语句。(finally不会执行)
(12)Order of try-catch-finally blocks matters. (若顺序错的话: error: No try before catch)
try-catch-final块的顺序问题。
(13)main() can be declared final. (OK)
main()方法可以声明为final。
(14) -0.0 == 0.0 is true.
(15)A class without abstract methods can still be declared abstract.
没有抽象方法的类,仍然可以定义为抽象类。
-
SUN认证考试流程详细
Sun在UNIX领域一直是技术上和市场占有率的领先者;近年来又推出Java技术,更成为业界的标准。以下是小编整理的关于SUN认证考试流程详细,希望大家认真阅读!SUN认证基本知识Sun推出的专业认证包括下列三种:SUN认证种类Java认证考试关于Java方面,Sun推出四项认证:SunCer...
-
Sun Java认证考试科目
SunJava认证SunCertifiedAssociatefortheJavaPlatform,StandardEdition,ExamVersion1.0(310-019)SunCertifiedProgrammerforJava2Platform1.2(310-025)SunCertifiedDeveloperforJava2Platform(310-252A、310-027)SunCertifiedProgrammerforJava2Platform1.4(31...
-
Java学习要点汇总
Sun公司对Java编程语言的解释是:Java编程语言是个简单、面向对象、分布式、解释性、健壮、安全与系统无关、可移植、高性能、多线程和动态的语言。下面小编准备了关于Java的学习要点,提供给大家参考!1.你需要精通面向对象分析与设计(OOA/OOD)、涉及模式(GOF,J2EED...
-
Java方法(函数)传值和传引用的问题
java方法中传值和传引用的问题是个基本问题,但是也有很多人一时弄不清。下面YJBYS小编为大家整理了关于Java方法(函数)传值和传引用的问题文章,希望对你有所帮助。(一)基本数据类型:传值,方法不会改变实参的值。publicclassTestFun{publicstaticvoidtestInt(inti){...