Assign a variable inside an “if” bracket, how do you use that variable outside the bracket?

Inside your public void fractalEngine(int pxLength, String fractalRule) just declare the local variables right after the { symbol: public void fractalEngine(int pxLength, String fractalRule) { String verifiedChoice1 = ""; String verifiedChoice2 = ""; String verifiedChoice3 = ""; //Logic here.. } These local variables is only visible inside the method block and cannot be visible outside of the method Just make sure you remove the String word that you mentioned inside your if statement and it can be used locally inside your method.

Inside your public void fractalEngine(int pxLength, String fractalRule) just declare the local variables right after the { symbol: public void fractalEngine(int pxLength, String fractalRule) { String verifiedChoice1 = ""; String verifiedChoice2 = ""; String verifiedChoice3 = ""; //Logic here.. } These local variables is only visible inside the method block and cannot be visible outside of the method. Just make sure you remove the String word that you mentioned inside your if statement and it can be used locally inside your method.

Correct. However, you might want to add that the variable isn't accessible from the outside because the scope of variables is limited to it's block. – EinLama Jun 30 at 8:27 THANK YOU!

I've literally been staring at the screen for hours trying to figure this out! It worked like a charm! :D – Chris Jun 30 at 8:29 @EinLama, true, hence why I stated it's a local variable.

I'm assuming the OP understands what local variable means. – The Elite Gentleman Jun 30 at 8:30 @Chris, you're welcome. Don't forget to accept your answer that helped you.

:) – The Elite Gentleman Jun 30 at 8:37 @The Elite Gentleman I went to do it, but it said I have to wait 5 minutes, so I'll accept it then. – Chris Jun 30 at 8:39.

This is a scope problem. You need to pull the declaration out of the if clause and separate that to the instantation. You probably will need to initialise it with null too to stop Java complaining.

For example: function() { String verifiedChoice = null; if { verifiedChoice = ... } } Some people prefer to initialise with "" however I choose null because if you do forget to instantiate it afterwards you'll get NPE exceptions interacting with the String object afterwards.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions