Results 1 to 1 of 1
- 05-09-2011, 09:01 AM #1
Senior Member
- Join Date
- Feb 2009
- Posts
- 182
- Rep Power
- 5
"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!
page 93
I commented the questions
Java Code:import java.util.*; import static net.mindview.util.Print.*// I don't understand the use of the URL or why use STATIC here.
page 137
why are
page 138Java Code:[COLOR="Green"]System.out.print(result + ", ");[/COLOR] and [COLOR="Green"]return result; [/COLOR]both listed? Shouldn't it just be the first line?
page 141Java Code:code snippet... for(char c = 0; c < 128; c++) // You can do math on chars without casting them?
What does this do?
page 145Java Code:Random rand = new Random(47); // make a random num up to 47?
page 149Java Code:// what does it do when System.out.println() is by itself?
what does "while("true") do?
page 153
I don't understand the role of "a" or "nextInt" in this code, and I don't understand the book explanation.
Java Code:int c = rand.nextInt(26) + 'a';
Last edited by silverglade; 05-09-2011 at 09:29 AM.
Similar Threads
-
Exception in thread "main" java.lang.NumberFormatException:input string: "060320
By renu in forum New To JavaReplies: 14Last Post: 04-08-2011, 06:01 PM -
Java, Military Format using "/" and "%" Operator!!
By sk8rsam77 in forum New To JavaReplies: 11Last Post: 02-26-2010, 03:03 AM -
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks