概念C
文章平均质量分 52
miss_yu
这个作者很懒,什么都没留下…
展开
-
如何理解Spring反向注入?(Spring 之旅)
1 我們平時正常思維是什麼?而spring的反向注入如何理解? 帶這些問題,開始我的Spring 之旅 以前的關係如下圖 現在的關係如下圖 Spring 的核心概念是 IoC,IoC 的抽象概念是「依賴關係的轉移」,像是「高層模組不應該依賴低層模組,而是模組都必須依賴於抽象」是 IoC 的一種表現,「實現必須依賴抽象,而不原创 2005-07-22 12:09:00 · 1745 阅读 · 0 评论 -
6.Overloading, Overriding, Runtime Type and Object Orientation (inner)
1.There is no restriction on the return type. If the parameters are different then the methods are totally different (other than the name) so their return types can be anything.2.Note the difference b原创 2005-08-29 15:49:00 · 871 阅读 · 0 评论 -
5.Operators and Assignments
1. ++/--前缀 是先加+/-1 ,再赋值 .如 int x ; log.info( " ++x= "+ ++x ) ; // ++x = 1 log.info( " x = "+ x ); // x = 12. 后缀++/-- 是先赋值,再+/-1 如; int x ; log.info( " x++ = " + x++ ) ; //原创 2005-08-29 15:51:00 · 602 阅读 · 0 评论 -
4.Language Fundamental
1 , 简单类型 长度 范围byte -2 ^7 to 2^7-1 –128~127 char 0 - 2^16-1 0~65535( no 65536) ASCII 码的范围仍然是0~127short -2 ^15 to 2^15-原创 2005-08-29 15:57:00 · 692 阅读 · 0 评论 -
3.Garbage Collection
1.Objects passed to the method are never garbage collected in that method. So p cannot be GCed. x is not an object. "abc" is a string literal which goes to the string pool and is not GCed. So, onl原创 2005-08-29 15:57:00 · 747 阅读 · 0 评论 -
Serializable 和 transient 的關係
1.Serializable只有一个实现Serializable接口的对象可以被序列化工具存储和恢复。Serializable接口没有定义任何成员。它只用来表示一个类可以被序列化。如果一个类可以序列化,它的所有子类都可以序列化。声明成transient的变量不被序列化工具存储。同样,static变量也不被存储。private void serializeSessionObject(原创 2005-10-05 08:54:00 · 1811 阅读 · 0 评论 -
继承,抽象,接口之间的关系和区别
1. 继承中子类可以拥有父类中的属性和方法,而不需要在子类中重新写出来2. 抽象夹在继承和接口中间状态, 父类中定义的抽象方法体;子类需要实做其父类中所定义的抽象发法体,否则子类也为抽象类.3. 接口中的定义的方法体,在其子类中必需全部实做4.Access 的用法4.1 接口中的方法只可以用private ,public ,因為它的方法實現類只能用public 4. 2. 父類中的方法,可原创 2005-06-06 09:54:00 · 1316 阅读 · 0 评论 -
UML 圖標表示的內容
1。依赖(use-a :依赖关系)C2 - - - -> C1 已C1作为方法的返回类型,或C1出现在C2的方法中的局部变量或者方法的参数里,或在C2的方法中C1的静态方法被调用等2。关联(has-a :关联关系)2。1 聚合 (部件组合)C2 C1 C2中有实例变量C12。2 合成 (独立个体组合)C2 ----->C1 C2中有实例变量C13。继承(is-a :继承关系--例:A类原创 2005-10-27 10:28:00 · 2574 阅读 · 0 评论 -
EJB
会话bean管理用户会话,实体bean管理数据访问,而消息驱动bean相应JMS消息1.有状态和无状态会话bean的本质区别现实中,很多朋友对两种session bean存在误解,认为有状态是实例一直存在,保存每次调用后的状态,并对下一次调用起作用,而认为无状态是每次调用实例化一次,不保留用户信息。仔细分析并用实践检验后,你会发现,事实恰好相反:有状态和无状态会话bean的本质区别是它们原创 2005-10-31 09:41:00 · 803 阅读 · 0 评论 -
7.Threads
1.Synchronizedblock 中的 wait(),notify(), 为同一物件的不同线程调用才可相互起作用.Any object canbe a monitor. wait()/notify() methods are in Object classes and not in Threadclass.2.A Thread is created by doing new原创 2005-08-29 15:49:00 · 591 阅读 · 0 评论 -
8.java.lang Package
1.The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@, and the unsigned hexadecimal representation o原创 2005-08-29 15:32:00 · 777 阅读 · 0 评论 -
多線程
如何創建線程Thread 类定义了多种方法可以被派生类重载,,必须重载run()方法1.实现Runnable接口 如果你不需要重载Tread的其它方法时,最好只实现Runnable接口// Create Thread method one is implements Runnableclass NewThread implements Runnable{ Thread t; NewThrea原创 2005-07-25 14:25:00 · 724 阅读 · 0 评论 -
类型转换(向下强制)
类型转换(向下强制)1. 向上转型比较安全 int i =1; double result = i ; Employee e = new Manager();2. 向下转型不安全(因为父类中不一定有子类的一些属性和方法),需要强制转换 double d=4.9999999; int result = (int) d ; Manager m = (Manager原创 2005-07-24 09:44:00 · 1312 阅读 · 0 评论 -
散列碼(hashcode)
1.在散列(hashing)中,一個關鍵字的信息內容被用來確定唯一的一個值,稱位散列碼(hashcode) 2.1. Rule: If the equals() method returns true, then hashCode() for both the objects must return the same value. Note that the reverse is not req原创 2005-07-28 15:25:00 · 1114 阅读 · 0 评论 -
Exception
表 Java的java.lang中定义的未检查异常子类异常说明ArithmeticException算术错误,如被0除ArrayIndexOutOfBoundsException数组下标出界续表异常说明ArrayStoreException数组元素赋值类型不兼容ClassCastException非法强制转换类型IllegalArgumentException调用方法的参数非法IllegalMo原创 2005-08-20 12:38:00 · 656 阅读 · 0 评论 -
簡單數據類型注意點
1. 只有double ,float,Long 定義變量時,在所賦值後面可以加d f L ,如果在調用方法時如 amethod(5.0) 改5.0默認問double2. 整型賦值注意以下几點: int d = 17; int o = 017; // 0 rexpess digit 17=1*8+7=15 ; int o = 019 ; error digit 0~7原创 2005-08-17 17:14:00 · 486 阅读 · 0 评论 -
1.Declaration And Access Control
1General Commentsstatic and final are valid modifiers for both variable and method declarations within a class. transient and volatile modifiers are only valid for variables. abstract原创 2005-08-17 20:27:00 · 543 阅读 · 0 评论 -
2.Flow Control, Assertions And Exception Handing
1.1assertions may be used to validate the input parameters of a private method. This is because, private methods are called only by the developer of the class. Therefore, if a private method is called原创 2005-08-17 20:30:00 · 1018 阅读 · 0 评论 -
9.java.util Package
1java.util.Collection | +--Set , List | | +--SortedSet + (Vector) java.util.Map | +--SortedMap , (Hashtable) interfaces effectively. Coll原创 2005-08-17 21:02:00 · 657 阅读 · 0 评论 -
硬性规定,必须遵守
1。接口不是类,不能用new实例化一个接口.但可以用接口定義一個變量= new 具體類(必須是implements了該接口的)接口 var = new Class (implements 接口)2。static 成员不能多态继承3. 抽象類不能實例對象, 具體類和接口可以實例對象4. 同步不能繼承原创 2005-11-28 12:04:00 · 818 阅读 · 0 评论