Java

本类阅读TOP10

·使用MyEclipse开发Struts框架的Hello World!(录像1)
·hibernate配置笔记
·AOP编程入门--Java篇
·linux下Tomcat 5.0.20 与 Apache 2 安装/集成/配置
·在win2003下整合了整合Tomcat5.5+ apache_2.0.53+ mod_jk_2.0.47.dll
·构建Linux下IDE环境--Eclipse篇
·Jsp 连接 mySQL、Oracle 数据库备忘(Windows平台)
·ASP、JSP、PHP 三种技术比较
·Tomcat5.5.9的安装配置
·AWT GUI 设计笔记(二)

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
关于SCJP1.4考试的一些需要注意的地方(六)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

 

101.方法中throw RuntimeExceptionerror不必在方法中声明

       这和throw checked Exception不一样

102CatchX xcan catch subclass of X

103.RuntimeException is the immediate superclass of NullPointException

104.rethrow 异常时,方法中也要声明抛出异常。

105.不可以在方法内部定义static变量,static方法不可以被继承

106Assert抛出的异常Exception in thread “main” java.lang.AssertionError:true

       其中trueexpression2 的值

107Catch(Exception e){}  try中不抛出异常,仍然可以编译通过

108.两个break不可以连着,因为有一个break reach不到,所以compile error

109Class A{

       Void A(){}

}    这不是错误,只是一个普通的方法罢了。

110Int[] score={3,4,5,}   (right)

       Int [] aa=new int[3]{1,2,3} (wrong)

111.如果在方法中声明了一个对象,返回的是对该对象的引用,则无法判断该对象是否可以回收

112Condition compilation is used to allow tested class to run at full speed.

113.the default constructor has the same access as its class

114. do not use assertions to validate arguments to a public method and command-line

       Do not use assert expressions that can cause side effect

       Do use assertions to check for cases that you know are never even supposed to happen

115.abstract class have constructors and those constructors are always called when a concrete subclass is initiated.

116.An interface has no constructor, because it is not part of an objects inheritance tree.

117.private的构造函数只是不能被继承而已,不会因此compile error

118.boolean b=Boolean.TRUE   (wrong)

119.public synchronized void run(){}   (right,并且也覆盖run方法)

120String s=”abc”; Object o=(Object)o;

       s.equals(o) =true  o.equals(s)=true  因为自动绑定

       String s=new String(“true”);

       Boolean b=new Boolean(true)

       s.equals(b) =false




相关文章

相关软件