⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scjp++

📁 scjp认证考试部分原题和模拟考试
💻
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0058)http://cuiguanyu.top263.net/pages/program/scjpexamtrap.htm -->
<HTML><HEAD><TITLE>SCJP考题中的陷阱</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR></HEAD>
<BODY bgColor=#d7edff>
<H1 align=center>SCJP考题中的陷阱 </H1>
<P align=center>崔冠宇转载 Ajith Kallambella </P>· Two public classes in the same 
file. <BR>· Main method calling a non-static method. <BR>· Methods with the same 
name as the constructor(s). <BR>· Thread initiation with classes that dont have 
a run() method. <BR>· Local inner classes trying to access non-final vars. <BR>· 
Case statements with values out of permissible range. <BR>· Math class being an 
option for immutable classes !! <BR>· instanceOf is not same as instanceof <BR>· 
Private constructors <BR>· An assignment statement which looks like a comparison 
if ( a=true)... <BR>· System.exit() in try-catch-finally blocks. <BR>· 
Uninitialized variable references with no path of proper initialization. <BR>· 
Order of try-catch-finally blocks matters. <BR>· main() can be declared final. 
<BR>· -0.0 == 0.0 is true. <BR>· A class without abstract methods can still be 
declared abstract. <BR>· RandomAccessFile descends from Object and implements 
DataInput and DataOutput. <BR>· Map doesnot implement Collection. <BR>· 
Dictionary is a class, not an interface. <BR>· Collection is an Interface where 
as Collections is a helper class. <BR>· Class declarations can come in any order 
( derived first, base next etc. ). <BR>· Forward references to variables gives 
compiler error. <BR>· Multi dimensional arrays can be sparce ie., if you imagine 
the array as a matrix, every row need not have the same number of columns. <BR>· 
Arrays, whether local or class-level, are always initialized, <BR>· Strings are 
initialized to null, not empty string. <BR>· An empty string is NOT the same as 
a null string. <BR>· A declaration cannot be labelled. <BR>· continue must be in 
a loop( for, do , while ). It cannot appear in case constructs. <BR>· Primitive 
array types can never be assigned to each other, eventhough the primitives 
themselves can be assigned. ie., ArrayofLongPrimitives = 
ArrayofIntegerPrimitives gives compiler error eventhough longvar = intvar is 
perfectly valid. <BR>· A constructor can throw any exception. <BR>· 
Initilializer blocks are executed in the order of declaration. <BR>· Instance 
initializer(s) gets executed ONLY IF the objects are constructed. <BR>· All 
comparisons involving NaN and a non-Nan would always result false. <BR>· Default 
type of a numeric literal with a decimal point is double. <BR>· integer (and 
long ) operations / and % can throw ArithmeticException while float / and % will 
never, even in case of division by zero. <BR>· == gives compiler error if the 
operands are cast-incompatible. <BR>· You can never cast objects of sibling 
classes( sharing the same parent ), even with an explicit cast. <BR>· .equals 
returns false if the object types are different.It does not raise a compiler 
error. <BR>· No inner class can have a static member. <BR>· File class has NO 
methods to deal with the contents of the file. <BR>· InputStream and 
OutputStream are abstract classes, while DataInput and DataOutput are 
interfaces. <BR></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -