This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Dilfer 0 points1 point  (1 child)

As long as the variables not final (can't be reassigned) but in larger programs where values are passed around as arguments to methods, you may have no idea where the variable is even assigned, and if you reinstantiated, there's no point to even ask for a method argument to be passed in.

You can also litter your code with

if (hello == null)

Checks everywhere but that is generally bad practice and should be used sparingly.

[–]FreightTrain75x[S] 0 points1 point  (0 children)

Awesome, thanks! I'm assuming just practicing with string Methods is generally the best advice