J. Macha

Greenhorn
+ Follow
since Sep 14, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by J. Macha

use the -fall option on the compiler to generate the files
you are missing
idlj -fall myFile.idl
19 years ago
For the String.append issue see this discussion http://www.javaranch.com/ubb/Forum24/HTML/003520.html
For MediaTracker see http://www.javaranch.com/ubb/Forum24/HTML/002719.html and
Look at the question at the bottom of the following post this
is similar to the question on the exam. http://www.javaranch.com/ubb/Forum24/HTML/002144.html
As for the socket question just search this forum for "Sockets" you will find alot of post discussing the Socket.

This forum was very helpful with my preparation for the exam. Thanks to all its creators and contributors. I am sure it will be equally valuable when I go for the Developer Certification
As for the test
I had the now famous String.append question as well as the MediaTracker and Socket questions.
the following is a question from the pgjc book
Under which circumstances will a thread stop?
a) the method waitforId() in class MediaTracker is called.
b) the run() method that the thread is executing ends.
c) the call to the start() method of the Thread object returns
d) the suspend() method is called on the Thread object.
e) wait() method is called on the Thread object.
the book has the answer as ONLY B.
but depending how you take the word "stop" you could make a good argument for A,D, and E also being correct.
Any sugestions on how this type question should be handled on the exam. Should we consider stop to mean moved into a dead state, or moved into a non-running state.
I would say A,B are correct.
A - I remember reading this somewhere.
B - because setting the fill field to BOTH would cause the component to stretch to fill its display area thus the anchor value would have no effect on the component.
I agree that there are 11 string objects created and thus when the loop exits and tmp goes out of scope then 11 String objects should be ready for GC.
I am a little confused by the explination about 10 of the objects being on the heap and the 11th being on the stack.
The questions are from the pgjc mock exam application.
I guess they fixed the questions in the book (mine is the same as you said) but they did not correct the exam engine that is on the website.
thanks
The questions are from the pgjc mock exam application.
I guess they fixed the questions in the book (mine is the same as you said) but they did not correct the exam engine that is on the website.
thanks
The pgjc exam also has the following question.
Which are valid identifiers.
a) class
b) $value$
c) zer@
d) angstrom
e) 2much
it has the answer as being A,B,D
but class is a reserved word so it can not be used as an identifier
What about a private static inner class.
a static inner class is considered a top level class and it can be private.
The following is a question from the pgjc - mock exam that i think has an incorrect answer.

1. Which of statements are true concerning the effect of the >> and >>> operators?
a) for non-negative values of the left operand, the >> and >>> operators will have the same effect.
b) the result of (-1 >> 1) is 0
c) the result of (-1 >>> 1) is -1
d) the value returned by >>> will never be negative as long as the value of the right operand is equal to or greater than 1
e) when using the >> operator, the left most bit of the bit representation of the resulting value will always be the same bit value as the leftmost bit of the bit representation of the left operand.
the mock exam has the answer as A,D,E
i think that the correct answer is A, E
D is incorrect for example (-10 >>> 32) is still -10
The following is from "A Programmer's Guide to Java Certification"
"When a method is invoked on an object using a reference, it is the class of the current object denoted by the reference, not the type of the reference, that determins which method implementation will be executed. When a variable of an object is accessed using a reference, it is the type of the reference, not the class of the current object denoted by the reference, that determins which variable will actually be accessed."
page 181 2nd paragraph under Variable Shadowing.