Results 1 to 1 of 1
  1. #1
    silverglade is offline Senior Member
    Join Date
    Feb 2009
    Rep Power

    Default "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

    Java Code:
    [COLOR="Green"]System.out.print(result + ", ");[/COLOR]
    [COLOR="Green"]return result; 
    [/COLOR]both listed? Shouldn't it just be the first line?
    page 138

    Java Code:
    code snippet...
    for(char c = 0; c < 128; c++) // You can do math on chars without casting them?
    page 141

    What does this do?

    Java Code:
    Random rand = new Random(47); // make a random num up to 47?
    page 145

    Java Code:
    // what does it do when System.out.println() is by itself?
    page 149

    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

  1. Replies: 14
    Last Post: 04-08-2011, 06:01 PM
  2. Java, Military Format using "/" and "%" Operator!!
    By sk8rsam77 in forum New To Java
    Replies: 11
    Last Post: 02-26-2010, 03:03 AM
  3. Replies: 1
    Last Post: 11-20-2009, 07:58 PM
  4. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts