Java object handle (pointer, reference address) __java

Source: Internet
Author: User
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
	}

}


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.