学习资讯
当前位置: 华夏学习网 > JAVA认证 > JAVA认证动态 > Java认证之精辟总结

Java认证之精辟总结

http://edu114.cn     2006-07-16 15:31      发布:华夏学习网

3.switch里面只能是short,int,char,byte的.
4.if (a="a") 编译错, if(a=false)编译ok,原因是a=false的a代表了个boolean值
6.这种写法Outer.Inner i = new Outer().new Inner(); OK!
7.文件里, 8 默认是int, 8.0默认是double
8.八进制是 0开头,不是O(英文o)
9.byte -128~127 ,-128是二进制的多少?????????????
11. -1>>32还是-1, -1>>>32为什么还是-1???????????????????
12. char c=´c´; String s ="s"; s+=c;结果是 sc!!!
13. boolean b1=true; boolean b2=true; System.out.println(b1|b2); 结果是true.编译没错!
?????java的默认import包有哪些???????
AWT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. 所有组件flowLayout会被压缩为它们的最小尺寸
2. BorderLayout的North,South,West,East,Center就是这个样子,四个单词大小写区分,必须这么写,否则错?????????
2.1如果只是add,而不写东南西北中,默认是中
2.2如果不加component到中,那中就空着
2.3如果某个方位有个component,如果你还往上面加component,后来的会覆盖原来的
3. applet,panel默认布局是flowlayout
4. frame,dialog默认布局是borderlayout
5. 各种awe类的继承关系,frame,window,component,...??????????
6. window,frame,dialog不能被嵌入到容器里.注意:window!
7. action event作用于button和textfeild的回车时刻
8. item event作用于list,choice,checkbox的选择改变时刻
9. 如果容器不可见,新layout器后前的component将跟随这个新的layout变化,如果容器可见,这些component将不受后来的layout影响
10.gridLayout里的component尺寸一样
11.gridBagLayout里,component可以占用多个grid
12.System.exit();在Applet里面不允许调用.
AWT事件
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.事件类有
(symantic)语义事件:ActionEvent,AdjustEvent,ItemEvent,TextEvent
低级事件:ComponentEvent,ContainerEvent,FocusEvent,InputEvent,KeyEvent,MouseEvent,PaintEvent,WindowEvent
2.监听器:
ActionListener,AdjustListener,CompentListener,ContainerListener,FocusListener,ItemListener,
KeyListener,MouseListener,MouseMotionListener,TextListener,WindwosListener, 共11个Listener,
七个adpter,少的4个是ActionLisenter,AdjustListener,ItemListener,TextListener,它们只有一个方法.
3,鼠标MouseListener有5个方法:clicked,pressed,released,entered,exited
4.鼠标MouseMotionListener有2个方法:mouseDragged,mouseMoved

类和对象(Class and Object)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0.最外层的类可以声明成final: "$file a":< final class a{}> ok!,但是不能是private和static的.
1.overload是同类里同样的方法名,override是父子的继承
2.override的返回结果必须一样,否则编译错哦
The return type of an overriding method is identical to the return type of the method it overrides.
2.1 override的modifier可以扩大,但是不能缩小.比如父类private void test(){} 子类:public void test(){} ,没问题;如果反了,就死翘翘了!
3.super.super(),靠,错的,没这么写的
4.static和非static之间永远无法override!
5. 看程序
public class A{

  找朋友,学知识,来华夏学习网 © 2004-2009 edu114.cn  京ICP备06063949