This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I did some corrections and the .java file compiled without any error but the error began in the output
Here is my code..Is My conversion of the int random numbers into string and using in checkyourself method is wrong?If not then why the output error..the program gets stuck asking-enter the number perpetually.
You're doing some strange things in lines 49 to 56.
In line 49, you're generating a random number. You're not using that anywhere. In lines 51 to 56, you are adding strings that contain "randomNum", "randomNum+1" and "randomNum+2" to a list. Note that those are literally those strings - it looks like you expect that these strings will be evaluated to contain the random number, plus one or two, but that is not what happens. If you use a variable name in a string literal, it's not going to be evaluated automatically.