Toby Davis

Ranch Hand
+ Follow
since Apr 09, 2002
Merit badge: grant badges
For More
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 Toby Davis

Know these methods for String:
charAt, concat, equalsIgnoreCase, length, replace, substring, trim, toString, toLowerCase, toUpperCase (also "equals" should be in the list - in fact, it's an Object method so it should be obvious - so understand how equals can be overriden and implemented, and its contract... it may show up on the exam for Strings)
StringBuffer: append, insert, reverse, toString
(Let me know if I missed one above, anyone...)
Be aware of incorrect String method being applied to a StringBuffer, or vice-versa. Understand the substring's arguments, where first element is index-based (0-based) but the second element is position-based (1+). If you understand String's immutability, then you'll have no problems understanding how String objects cannot be changed, while StringBuffer objs can - and how to catch that in code questions on the exam.
If you have the K&B book (and if you don't, I highly recommend it), Chapter 6 was excellent on this objective...
[ August 09, 2003: Message edited by: Toby Davis ]
Passed the 1.4 exam, scored 80%. Like most everyone else, my lowest section scores were Threads and GC (66% each). Inversely I did very well on Flow Control/Assertions/Exception Handling, java.lang classes, Language Fundamentals, and Overloading/Overriding/Runtime/OO. Remaining sections were average to above-average (75-80%).
- programmed Java since '97 (off and on), with bulk of my Java experience in web apps (J2EE) realm
- spent most of the past year doing C# instead of Java
- decided cert was best way to get back into Java after being in .NET land
I used only the K&B book, and took both CD mock exams (88% and 86% each), as well as 4 of Dan Chisolm's exams (didn't score myself on those). Total of a week of hard studying. (Also attended a local JUG's weekly exam-preparation session this past spring, but missed half the sessions and never really studied hard then due to work conflicts).
Comments (for my version of the exam):
- the real exam was a bit tougher than the K&B exams, and a bit easier than Dan Chisolm's
- format and similiarity of questions definitely close to K&B
- a good 25% of the exam covered GC and Threads (our favorite subjects)
- very little emphasis on bit shifting (i recall maybe one question on it, though that may not be the case for others)
- even mix of code-based and "sentence"-based questions EXCEPT in Collections (I don't recall seeing one code-based ? on it - again, may be different for others)
The rest had a good mix of topics, though it had more emphasis on Threads than K&B mock exams did.
Oh - and, no, there will not be subject headers for each question, like the LearnKey K&B has.
Anyway, that's all I can think of right now short of giving up actual questions .
20 years ago
It seems you can also use strictfp as a modifier as well in method-local inner classes... by itself or combined with either final or abstract....
Surprised this wasn't in the book, though it compiles fine with Sun's JDK.

Originally posted by Andres Gonzalez:
BTW, do you get the same answer as mine?

Yes. Exam II keeps insisting compilation error... and I keep insisting it's a runtime exception. Bert's master copy is correct, CD copy is not. Hmph.
(If I missed the following during a search on this forum, my apologies in advance...)
On K&B CD Exam (Sun Certified...II), here's a question on arrays:

The answer I chose was "Runtime Exception", since a1[1][0] will give you a NullPointerException. The LearnKey answer, however, said that there was compilation error at line 6.
This one seemed easy, but I ran the code anyway to be sure (using Sun JDK 1.4.1), and got the NullPointerException, as expected.
I believe's there's an error in the answer key for this one... can anyone confirm (or point to a forum on this that I missed)?
Forgot to add: the MasterExam #3 (that combines that first two) DOES give you 2 hours. Strange how #1 and #2 only give 90 mins, like you mentioned. Either way, I was able to finish them in a little over an hour... so I'm not too worried.

Originally posted by Marlene Miller:

The first line of each question for #1 says
Sun Certified Programmer for the Java 2 Platform (Exam 310-035)
The first line of each question for #2 says
Sun Certified Programmer for the Java 2 Platform (Exam 310-035)II
The first line of each question for #3 sometimes says
Sun Certified Programmer for the Java 2 Platform (Exam 310-035)
and other times says
Sun Certified Programmer for the Java 2 Platform (Exam 310-035)II

Well, I was putting post-it notes over the top of the window so I couldn't see which topic each question covered (hints like that won't be on the real exam I'm sure)... so I wasn't paying attention to titles. Thanks for letting me know, it makes sense now.

Originally posted by Bert Bates:
You'd think I'd know, but frankly I'm not sure what learnkey has done recently :roll:
I will tell you this, I only wrote ~130 questions for the master exams, so if there are 3 sets, they are reusing questions. As far as the 90 minute time limit, we're REALLY trying to twist the publisher's arm to get that fixed. If a BUNCH of JavaRanchers wrote to Osborne maybe we could light a fire under them!!

The "Sun Certified..." exams (one comes with CD and the bonus you can download) probably make up your 130 q's. The "MasterExam" (exam 3) just combines those two, it seems. At least Exam 1 and Exam 2 have different q's, so I feel better.

Originally posted by Bert Bates:

Thanks for using the book, and let us know how you do on the real exam!

I'm taking it day after tomorrow, will let you know how it goes! Good book, by the way...
[ August 05, 2003: Message edited by: Toby Davis ]
After downloading the bonus exam, I have 3 total MasterExams from the CD. I'm unclear on whether questions are unique between the 3 exams:
1. Sun Certified Programmer ...
2. Sun Certified Programmer ... II
3. Master Exam for Sun Certified ...
Here's what I've done so far:
- took #1 (closed book) a few days ago for 88%.
- took #3 (closed book) today 87.5% (875 out of 1000). However, when I looked at the exam results for Master Exam #3, it showed total score AND two categories for my score:
Sun Cert... II with category score of 80
Sun Cert... with category score of 95
It looks like Master Exam #3 is pulling questions from #1 and #2, correct? A good portion of the questions seemed very familiar. I just want to be sure I'm having a fairly unique set of questions per exam, before I take #2 exam...
(Oh, and from other threads I've read, scoring on these mock exams are fairly close to the real thing).
Need a high-level opinion.
In writing a resultset to file (through JDBC connection), is it more efficient to write straight to file while looping through the resultset? Or better to put the resultset into a util collection (such as an ArrayList) and then close the JDBC connection before writing the collection to file?
Pros and cons, anyone?
For this particular app, total number of users is less than 50, and each file written has a unique name (as guaranteed as possible with 50 ppl).
Will two File objects being read/written cross threads even though each object was instantiated with unique names?
I had thought each filestreaming to a specific File object instantiated within a thread in the servlet would occur within that thread and not crossover to another thread (user) in the same servlet?
Want to be sure I don't do overkill on sychronization in file I/O if the above is true...
Am I making sense?
[ October 22, 2002: Message edited by: Toby Davis ]
21 years ago
Probably already answered myself with this question, but here it goes...
Are file I/O operations, such as reading/writing files using standard* filestreaming, fall under the umbrealla of servlet thread-safety as long as its written within a servlet's service-based methods or in the JSP itself (where it compiles into a servlet in the app engine)?
Again, this assumes no class (non-static) variables are being used and no application-level objects are being altered, etc. Also assumes file-locking has been considered and trapped for.
21 years ago
Saw it in the forum post, but didn't think of it since I had used a much older version unsuccessfully.
However, seems that 0.6.6 is working fairly well. I hope it's good for a production environment.
21 years ago
That won't work. While you can list all "drives" on your machine, including mapped ones, you can't write or read files on mapped drives. That falls under SMB protocol.
21 years ago
If I understand you correctly, you want to write a file to a different machine on your network (one which your web app does not reside locally). Windows NT/2000 uses SMB protocol for file sharing. Java has no official SMB support. There may be workarounds through JNI, but I found no docs on this, and I'm not a C++ programmer.
Started a forum on this here.
[ October 21, 2002: Message edited by: Toby Davis ]
21 years ago
It appears there is no Samba (Win networking) support in Java, at least officially.
Of course, there's always workarounds... but nothing I can think of that would work on a production environment. I'm not a C++ programmer so JNI is out...
Any ideas, if any, are welcome.
21 years ago