Results 1 to 1 of 1
- 05-09-2011, 09:01 AM #1Senior Member
- Join Date
- Feb 2009
- Rep Power
"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 java.util.*; 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] and [COLOR="Green"]return result; [/COLOR]both listed? Shouldn't it just be the first line?
code snippet... 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';
Last edited by silverglade; 05-09-2011 at 09:29 AM.
- By renu in forum New To JavaReplies: 14Last Post: 04-08-2011, 06:01 PM
- By sk8rsam77 in forum New To JavaReplies: 11Last Post: 02-26-2010, 04:03 AM
- By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 08:58 PM
- By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 07:56 PM
- By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM