Be careful nullpointerexception

Source: Internet
Author: User

Nullpointerexception

It's so ubiquitous that I ran it out accidentally.

Debugging is required for the victim for half a day.

 

Note the following secret points:

For example, for native type encapsulation such as integer, they can be used in the place where native types are used, and they will be implicitly converted by themselves. However, if the conversion is null before the conversion, it will be a tragedy, the nullpointerexception is thrown.

 

For example

Void func (int ){}

 

 

Integer A = NULL;

Func ();

 

At this time, a null pointer exception will be thrown in func (a); it will be silly if you have never experienced it...

 

 

PS:

I have never written a blog for a long time.

There is also a photography blog, which has not been updated for a long time. Even if you are free, you can take the camera everywhere...

Address:

Http://lifangeye.blogbus.com/

Lifangeye ......CubeWatching the world, haha

Is it better to lifangview... poor English...

 

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.