Skip to content
Coding Fanatic
  • Android Development
  • News and Reviews
  • Road2Pro
  • Tutorials
  • Services
  • About

Undercover Bugger, 24/100 Days of Code

  • April 9, 2019April 9, 2019
  • by Richard Clarke

Good thing I decided to clean up my code. I ended up finding and fixing a nasty bug.

Before, my code output a jumbled mess of test information. The output now displays the obtained address numbers and names. I also applied a bugfix to prevent the list of street numbers and names from resetting with each iteration of the do while loop.

Truthfully, the variables for these lists were declared in the wrong place…inside the do while loop. I followed the same steps as I did with the return variable and declared them outside of the loop.

I could declare special variables like these at the start of methods to ensure their scope is always within reach. If I need a counter or something with a distinct scope, I can declare it accordingly.

The next step will be adding the address information to the right lists and separating it with commas. 

-CF

Related

How to Loop, 23/100 Days of Code
Final Turn! 25/100 Days of Code
Richard Clarke
Richard is currently a developer using Java and Android Studio to build custom applications for Android. Richard tutored in mathematics at Montgomery College, and worked in Information Technology before entering the Software Development industry as a Quality Engineer.
100daysofcode Java Programming

Related articles

Your New Favorite Stopwatch App!…
Two for Two BABY! 7…
…But the App is for…
Play Store Blues – 5…
Top 4 Tips for Android…
No Dice – 3 of…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Join the mailing list!

This field is required.

Check your inbox or spam folder to confirm your subscription.

Follow me on social media!

  • GitHub
  • YouTube
  • X
  • Instagram
  • LinkedIn
My Tweets

Join the mailing list!

This field is required.

Check your inbox or spam folder to confirm your subscription.

Follow me on social media!

  • X
  • GitHub
  • LinkedIn
  • YouTube

Archives

Theme by Colorlib Powered by WordPress