"Thinking In Java" book questions
Hi, I have some questions from the awesome book "Thinking in Java" by Bruce Eckel. I saved up the questions to put in one post rather than making a ton of single question posts. I probably would get more help with single posts. But I waited. Any help GREATLY appreciated.
Ok I will list the pages, add the code, and comment the questions. Thank you!
I commented the questions
import static net.mindview.util.Print.*// I don't understand the use of the URL or why use STATIC here.
[COLOR="Green"]System.out.print(result + ", ");[/COLOR]
[/COLOR]both listed? Shouldn't it just be the first line?
for(char c = 0; c < 128; c++) // You can do math on chars without casting them?
What does this do?
Random rand = new Random(47); // make a random num up to 47?
// what does it do when System.out.println() is by itself?
what does "while("true") do?
I don't understand the role of "a" or "nextInt" in this code, and I don't understand the book explanation.
int c = rand.nextInt(26) + 'a';