Todd Patrick

Ranch Hand
+ Follow
since Jan 30, 2004
Todd likes ...
Android Firefox Browser Java
Husband, father, programmer
Farmington, Connecticut
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Todd Patrick

That is definitely a very good idea and something that I will try today. Thank you.
7 years ago
From this quote, "Just save the images in memory and retrieve them from memory instead of the network when you need to."

If I create a Thread that has a Runnable in which downloads images and stores the image data in memory (variables within an Object), how can I reference the same Object from a different Thread to get the image data in memory?
7 years ago

Campbell Ritchie wrote:Are we discussing how to get a query to return results grouped and ordered by headers in SQL, or how to order them in Java™?

The query works fine, I believe. I just need to use the correct logic in Java to output what I've described above. This is on a mobile device, so I'd like to remove the extra query if at all possible.
7 years ago

Wouter Oet wrote:So if you have N productGroups you're doing N+1 queries while it could be done in 1 query. That isn't a great solution.

Completely agree, but I had to keep moving forward and I couldn't figure this out.
7 years ago
What I ended up doing is running a SQL statement that returned the distinct header values and looped through those values and then pass the header value to the inside loop which allowed me to output the example above.

I appreciate the help!

7 years ago
I've tried to initialize the "header" with the first header, which didn't work and I've tried it with an empty String.
7 years ago
I have a table with a PK, ID, ProductGroup


I can obtain each row in a for loop, but how do I implement the logic to structure the data as:


I've tried the following with the loop:

But I end up only getting the last two labels, if I set the header variable before the if statement inside or outside the for loop I end up printing out the header for each row.
7 years ago
Devaka, I completely missed Exam Lab for SCJP 6.0. I'll be happy to donate $25.00

Thank you.
I have the K&B book.

Which of the following services should I buy mock or practice exams from?

  • uCertify
  • Enthuware
  • Whizlabs

  • or all three?

    ramesh rocks wrote:Congrats Buddy . Give me suggestion to get high score....

    McKenzie's two books are a must. I've posted a few corrections to the books in this forum as well.

    I did not do well in the UML questions, I wish I had looked at different information on UML. The text based UML questions were somewhat easy to figure out by the process of elimination based on the knowledge gained in McKenzie's books, but the UML diagrams were tricky and beyond what was discussed in McKenzie's book.

    In other words, take other people's advice in this forum and look at other UML documentation and/or guides.

    For the code based questions:

  • Understand logical operators: || and &&
  • Understand the Unary and Postfix operators.
  • Loops - for, while, do
  • 8 years ago

    Cameron Wallace McKenzie wrote:Congratulations! I'm so glad my books could play a small part in your success.

    Great Score!

    -Cameron McKenzie

    Thank you. It wasn't a small part by any means, the books are extremely helpful.
    8 years ago
    EDIT: Sorry, I posted this to the wrong forum.

    I passed the SCJA today with an 83%.

    Woo Hoo!

    Anyway, the UML questions were not what I expected, in other words I should have studied other UML materials than what was in McKenzie's two books.

    A topic that made me sit back in my chair was something along the following lines:

    What is the result of running the following:

    class Smudge{
    public void main(){
    System.out.print("I like to smudge.");

    Does it compile? Yes, it does.

    Does it output "I like to smudge"? No.

    Does it throw an error at runtime? Yes. The error is "Exception in thread "main" java.lang.NoSuchMethodError: main", but the listed option falls into the line of "Does it error at runtime." The Java VM requires that the class you execute with it have a main method at which to begin execution of your application.

    Otherwise, the rest of the exam was as expected. Again, I only used McKenzie's two books.
    8 years ago
    Question 4-26 on page 94 has a misprint in the question.

    The question asks:

    Which of the following properly initializes a double to the value of 22.11?

    The question should ask:

    Which of the following properly initializes a double to the value of 10.11?

    On the same page, the available answers are:

    a) double d == 10.11;
    b) double d = new Float(10.11);
    c) double d = 10.11F;
    d) double d = 10.11D;

    Answers on page 110 for this question are listed as the following with option c corrected according to the explanation.

    a) double d == 10.11;
    b) double d = new Float(10.11);
    c) double d = 10.11d;
    d) double d = 10.11D;

    Therefore b,c & d are correct.
    In the Mock Exam Questions book, page 352, question 16-10, the question states:

    Which of the following code snippets could legally be placed where the black box is:

    Sap s = new Sap();

    There is no black box in the question 16-10, nor on page 351, Figure 8-11.
    I believe the answers are wrong for question 13- 3 on page 286 in the McKenzie's Mock Exam Questions book.

    The question is:

    Given the declarations below, which of the following conditional statements would evaluate to true?

    a) (x1<x2)&&(x2>x1)
    b) (x1<x2)||(x2>x1)
    c) ! (b == true) && (x1 > d)
    d) (b == true) && (x1 > d)

    On page 295, it lists the correct answers as a, b, c - which I believe it should be a, b, d. I'm using Java(TM) SE Runtime Environment (build 1.6.0_18-b07).

    Answer c cannot evaluate to true because of the exclamation point before the left hand expression. The right hand expression does result in true, but the left hand expression would result in false.

    Am I missing something here?