Unsigned variable vs null variable

Asked

Viewed 40 times

2

I have the following codes:

String str = null;

and

String str;

If I use one if to check if the variables are null, if will be "called" in both cases. But is there any difference between the two codes? I think there’s a slight difference, because I can’t use an unsigned local variable, but I can use a local variable null.

  • I think the marked question answers what’s in here.

  • you are clearly in class or method ?

  • @Marcosbrinnerpikatoons in class

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.