[JAVA] It's just now, but it's slimy

What is Nullpo?

With the exception of NullPointerException, which will come with you for the rest of your life if you're dealing with Java Abbreviated as NPE etc. overseas The one that happens when you try to reference when there is no value to refer to in the reference type

If you know the Nullpo, you can know the reference type

Reference type

A reference type is a type that has the address of the memory that contains the actual value inside the variable. As an example String x =" A " At this time, what is actually stored in x is the address in the memory of "A". In other wordsx = 0001 0001 =" A "` It looks like this.

Unemployed with unspecified address

By the way, why is Nullpo finally happening? The state of null means that the address of the variable x is undefined. x = null Then x = undefined 0001 =" A " ` In a state where you do not know where the actual data is, with or without data in memory If you try to use x at this time, you will get a slimy feeling like "Hey, I don't know your address ~> <". In other words, NullPointerException feels like you can't meet an unemployed person with an unspecified address because you don't have an address.

Recommended Posts

It's just now, but it's slimy
It's just now, but a collection of commands that frequently appear in Rails
It's not "else if" but "else" and "if"