??????????????????????????????
????evaluate(“My Test Argument passed to param1”);
??????????????????????????????????????#1???????????
????????????????????????????????????????????????????????????????????????????????????????????????????JVM??????????е??????????????
public class A {
public int compute(int input) {       //method #3
return 3 * input;
}
}
public class B extends A {
@Override
public int compute(int input) {       //method #4
return 4 * input;
}
}
   ????B?е?compute(..)??????д??????compute(..)???????????????????????????
public int evaluate(A reference?? int arg2)  {
int result = reference.compute(arg2);
}
??????????????????????????reference????????A????B?????????????????????????????????“reference”??????????????磬A????B????????????????÷???#3???????#4.
??????????????????飩??????????????????????????????????????????????????????????????????????д????????????JVM??????????????????????“???????“?????仰??????????????????????????????????????????????汾1.4.0???????汾??JRE????????
????List<String> myList = new ArrayList<String>(10);
??????????????
List myList = new ArrayList(10);
???Annotation??????????????????????????????
public class B extends A {
@Override
public int compute(int input){   //method #4
return 4 * input;
}
}
????@Override???????????????????????????????????????????а?toString()д??tostring()???????????Java 5?У??????????????????????????(Anotation Process Tool ——APT)?????????д????????Java 6?????????????????????????????
public class MyTest{
@Test
public void testEmptyness( ){
org.junit.Assert.assertTrue(getList( ).isEmpty( ));
}
private List getList( ){
//implemenation goes here
}
}
????@Test??JUnit??????????????????????????????ò???????????Щ???????????
@Test (timeout=100)
public void testTimeout( ) {
while(true);   //infinite loop
}
????????????????100ms???????????????????????
@Test (expected=IndexOutOfBoundsException.class)
public void testOutOfBounds( ) {
new ArrayList<Object>( ).get(1);
}
????????????????????????????IndexOutOfBoundsException?????????????????????????????????????????????????????????????????Java????API????????AnnotatedElement??”Annotation”????????????
????????Exception???????????????????????????????
?????????????RuntimeException???????δ????????unchecked exception??????????????????????????????RuntimeException?????п???????????????????????????????????????????????е???????????RuntimeException??????????????????throw??????????????????
???????磺NullPointerException??ArrayIndexOutOfBoundsException?????
????????????checked exception?????????????????????У???????throws??????try{}cathch{} ?????????????????????????????Щ???????????????????????????????????
????????????????Aspect Oriented Programming-AOP???????????????????????????????????????????
????????????????????????????????????????????????????AOP???????????磬ajc – AspectJ???????????????б????????????????class?????AOP?????????????waver????á???????????????????????????????????????????????????????????????б????????????????????????
?????????????????????????????????????????????????е?class?????jar?????????????????????????????????????????????????????????????????????????????????檔
??????????????????????????????????????JVM????class???????????????????????????????????????????????????????????“???????weaving agent??“?????????????“????????????weaving class loader??”??