terminology in Java: Object handle handle (Handle), anything in Java can be viewed as an object, and there is a handle to an object that the identifier actually points to. In other parts of Java or in the data there are also referred to as "references" or "pointers". Just a reference address, we can not think that there is no pointer in Java, in fact, this is a pointer, each time we manipulate the object is based on the handle to find object action object. Even if there is no object, we can leave the handle alone. For example: Create a string handle: string str; But the only thing created here is a handle, not an object. The reference address is created, but it doesn't point to anything. If you send a message to STR at this point, you get an error (run time). This is because STR does not point to any object or variable, and we are often prompted to initialize the error when compiling.
Package multithread;
/**
* @ClassName: Handle
* @Description: definition of handle
* @author wanhaibing
* @date November 15, 2016 afternoon 4:08:30
* /Public
class Handle {
/**
* @Title: Main
* @Description: TODO
* @param @param args
* @return void
* @throws
*
/public static void main (string[] args) {
String s;
System.out.println (s); You will be prompted to initialize or you will get an error
}
}