Micah Holroyd

Greenhorn
+ Follow
since Jan 22, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Micah Holroyd

I took my first test a year ago with the old test format and just missed passing. I had read a couple books, but didn't have much experience with actual coding of Java, so I was a little unprepared for the test. But I didn't give up!
Throughout the next year, I was able to do several projects coding in Java, and studied when I got the chance. Whenever I read over a topic that I didn't fully understand, I created some sample code and played around with its output to make sure I understood the basic Java principles.
What made the difference the second time around was:
Khalid Mughal's book: Programmer's Guide to Java Cert.
This is definitely the best cert book out there.
The JQPlus practice exam, http://enthuware.com/jqplus/
The $20 cost is a bargain for such a quality study aid. Take all of their pre-set tests, and read through all of the explanations, even the one's you get right! If you can consistently pass these tests you will FLY through the real exam!
Tips for the test:
#1 - Try to relax! If you are passing the JQPlus tests then you know your Java and will do fine. Get some needed rest the night before you take it, and just try to think about how happy you will be after passing the test.
#2 - As everyone says, know threads, I/O constructors, and overriding/overloading. These topics make up almost 75% of the test.
#3 - I also had three or four questions on parameter passing. So make sure you know the difference between passing primitives and objects. There were several tricky questions regarding the passing of Strings, StringBuffers and arrays, so write some sample code to make sure you understand how these can and cannot be modified.
#4 - Also take part in Java Ranch discussions in the Certification forum. Just talking through your questions and answering other people's questions, will help you grasp the concepts and store them in your long term memory.
Hope this helps, and good luck with your studying!
23 years ago
The new test sounds like a great idea, since that whole part of Java development has been missed by the certification tests.
I thought it was also very interesting to read that they are "examining very carefully" moving the SCJP exam to adaptive format. Does that mean it would be more like the Developer's exam is currently?
And of course, changes to the programmer's certification test means that old certifications need to be upgraded: more money for Sun, and more work for us poor developers!
They said their recertification requirements would be "incredibly responsive and respectful" towards those they affect, but I guess we'll have to wait and see...
I have to disagree with you, Farhan.
Just because the declaration is in a loop, does not mean that it will generate a compiler error. The variable only has scope for each instance of the loop and then can be re-declared the next time through the loop.
That's why the code:

doesn't generate a compiler error.
Hey Shah, great questions!
Your first question has me a little puzzled too. You'll get the same results with "do-while" loops and "for" loops, if you don't use brackets.
Perhaps the people who wrote the compiler realized that having a declaration as the only line in a loop is kind of pointless, since that variable can't be used outside the loop.
As for your second question, I typed out your code and got the same compiler error message as you when I have "while(true)". But when I switched it to read "while(b)", I still got the same compiler error message, but it worked for you.
I'm using jdk1.3, what version are you using?
I don't think an inner class MUST extend any classes.
Of course all classes extend Object, but that doesn't need to be specified.
So an inner class CAN extend any classes or implement any interfaces that a normal class would be able to, but it doesn't have to.
Yes you can go back to previous questions, and you also have a chance to review all of your questions at the end before you hit the Finish Test bottom and get your grade.
And yes they give you scatch paper or the equivalent for jotting down notes, but they collect it at the end.
Thanks for your reply Fawad. However I'm still a little confused. In Mughal's book (pg. 567) it says,
"Java programs represent characters internally in the 16-bit Unicode character encoding, but the host platform might use another character encoding to represent characters externally."
To me, this is saying that Unicode is used internally. Am I not understanding this quote correctly?
Which of the following encoding schemes is used by the jvm internally for storing identifiers, etc?
a) Unicode
b) UTF8
c) ASCII
d) 8859-1
e) it depends on the platform
The listed answer is b, but I was almost certain the answer was a. If a is not the right answer, why not?
See the link I posted above. At the bottom of the page, it describes how to find what edition your copy is. It can be a little confusing, so good luck.
Even though the latest edition will be the cleanest, the site http://www.ii.uib.no/~khalid/pgjc/jcbook/errata.html
has errata listed for each edition separately. So whatever edition you get, you can be brought up to the latest version's standard by reading through the errata.
I was also having troubles with this question. Any explanations out there?
The only people I could see writing that code would be drunks, sadists, or writers of Java certification tests!
If you make the X variable final (see code below), then the compiler knows that X will always be 10 and can figure out that Y will be initialized. In the original code, the compiler can't be absolutely sure of what the value of X will be, so it can't predict whether Y will be initialized or not.
Thanks for your code sample, Lam. It does access the correct method by seperating the two supers into different classes. It steps up the hierarchy, rather than trying to put the two supers in one method call.
But I was under the impression that the question wanted a way to directly access A's method from an instance method in C.
The code below is an example of my idea:

I think Thomas' reply was the most correct out of all our answers, though. The question is worded a little ambiguously, so I have a point however picky it is. The only problem with my code, like Thomas said, is that the method in A will not have access to the current state of the C instance.
For this question:
Given classes A, B and C, where B extends A and C extends B and where all classes implement the instance method, void doIt(). How can the doIt() method in A be called from an instance method in C?
Select the one right answer.
(a) doIt();
(b) super.doIt();
(c) super.super.doIt();
(d) this.super.doIt();
(e) A.this.doIt();
(f) ((A)this).doIt();
(g) It is not possible.
The book says answer g is correct, saying that you can't chain supers, and that if you cast the this reference to A you could only access instance variables not methods.
But I think it is possible, even though none of the displayed answers are correct. You can call A's doIt() from the instance method in C by creating a new instance of A and then using that reference to call the method. I was able to do this in test code, so I know it works. Is there some wording in the question that I'm not understanding properly?
Any help would be appreciated.
Thanks.