- 浏览: 71913 次
- 性别:
- 来自: 北京
文章列表
import junit.framework.TestCase;
import junit.framework.Assert;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.Constructor;
public class TestReflectionGetFields extends TestCase {
public void testGetFieldsWillReturnOnlyPublicField
()
{
...
- 2009-10-15 21:35
- 浏览 628
- 评论(0)
java.lang.StringBuffer: thread-safe(之所以是thread-safe的是因为它的所有方法(构造函数除外)都是synchronized的)
java.lang.StringBuilder: not thread-safe, much faster than StringBuffer since no synchronization.
StringBuilder was introduced since JDK1.5 and it provides the same operation as StringBuffer.
AbstractStringBuilde ...
- 2009-10-14 23:47
- 浏览 1184
- 评论(0)
Explainations of Thread.State:
/**
* Thread state for a thread which has not yet started.
*/
NEW,
/**
* Thread state for a runnable thread. A thread in the runnable
* state is executing in the Java virtual machine but it may
...
- 2009-10-14 20:27
- 浏览 870
- 评论(0)
import junit.framework.TestCase;
import junit.framework.Assert;
public class TestStringIdentical extends TestCase {
public void testTwoConstantStringAreTheSame()
{
Assert.assertSame("hi", "hi");
}
public void testConstantStringIsTheSameAsItsReference()
{
String refere ...
- 2009-10-13 17:59
- 浏览 807
- 评论(0)