Gerry Timmermans

Greenhorn
+ Follow
since Dec 15, 2000
Merit badge: grant badges
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 Gerry Timmermans

Howdy.
I just wrote it today ... I was given 2 hours ... I read somewhere else in JavaRanch that it changed from 90min to 120min about a week ago.
Good thing too ... I think I would have felt rushed if it'd been only 90min.
Gerry
21 years ago

Hi all.
I didn't utilize JavaRanch as much as I would have if I'd found it sooner but I wanted to say thanks to those who answered my questions and those in the javacert discussion group who posted such detailed explanations of things.
I won't tell you what's on the exam (b/c that's unethical) except to say that it was probably a little tougher than I would have guessed, many of the questions are rather lengthy. Mind you I took the exam today b/c I didn't want to wait until after the holidays ... I could have used another 2-3 days of study time ... it showed as I only scored 69% ... but that's good enough.
With beer in hand ... thanks again ... Gerry
21 years ago
from appliedreasoning # 60
Which of the following code fragments will not cause a compile/runtime error at the <code here> section?
public class InnerTest
{
private String s = "outer";
private static int time = 1;

public static void main(String[] args)
{
new InnerTest().run(args);
}
public void run(String[] args)
{
int num = 4;
final int finalNum = 2;
class Inside
{
public void execute()
{
<code here>
}
}
new Inside().execute();
}
}
A. System.out.println(s);
B. System.out.println(args);
C. System.out.println(num);
D. System.out.println(time);
E. System.out.println(finalNum);
I picked E because I very have very specifically spelled out in my notes that a Local Nested Inner Class can access any final local variables in their scope. The solution claims that A, D, E are correct but I fail to see how s or time are final local variables in the scope of this Local Inner Class. I compiled the various solutions they suggest and indeed A, D & E all work fine. Am I missing something or do I have a misconception as to what final local variables are?. Please help.
Thanks in advance for the input ... Gerry

Taken from appliedreasoning.com mock quest #51
Which of the following statements about java.io.RandomAccessFile are true?
A. An instance of RandomAccessFile must be created with a mode.
B. When an instance of RandomAccessFile is created with a read mode, the underlying file will be created if it does not already exist.
C. When an instance of RandomAccessFile is created with a read/write mode, the underlying file will be created if it does not already exist.
D. The RandomAccessFile implements the java.io.DataOutput and java.io.DataInput interfaces.
E. If a RandomAccessFile is opened for read on a file that does not exist the FileNotFoundException is thrown.

First off, this is a hard mock exam! The answer given for the above question is A, C, D, E. I had only A & E. I missed C because I was sure I'd read somewhere that a RandomAccessFile will throw an exception if the file it refers to does not exist regardless of whether or not it is created "rw" or "r". I'm probably wrong but can someone confirm that these answers make sense. I'm going to try it out myself but I thought I'd throw it out to all you folk to ponder as well.
Thanks ... Gerry
Judy.
I believe ++k & k++ have the same precedence. (According to the description of numeric operators in Brogden's Java 2 exam prep)
Gerry
gc
Given the following: (paraphrased from a sample on the sun site)
1.public class X {
2.int w = 1;
3.public void m(Object x) {
4. w = 4;
//(edited)
6. x = new Integer(99);
7. Integer y = (Integer)x;
8. y = null;
9. System.out.println("x is" + x);
10. }
11.}
Is it correct to say that y is eligible for garbage collection after line 8. Is it also correct that x is eligible for garbage collection after line 10 (because it is out of scope).
[This message has been edited by Gerry Timmermans (edited December 20, 2000).]
OK. I missed that. Thanks very much for your help ... at least it's clearer than mud now.
21 years ago
Yes that helps immensely. I think I get the jist of it but I'm still confused why the example from the API shows
parseInt("2147483648", 10) throws a NumberFormatException. (1)
while
parseInt("2147483647", 10) doesn't. (2)
All the numbers in the String (1) belong to the subset of radix 10 do they not? I'm still missing something.
21 years ago
Can anyone explain how this method in the Integer class works. I understand the parseInt (String s) method no problem but I guess I am having trouble understanding what a radix is. I've included some examples from the API to demonstrate the results of calling this method. Please help ... Gerry.
parseInt("0", 10) returns 0
parseInt("473", 10) returns 473
parseInt("-0", 10) returns 0
parseInt("-FF", 16) returns -255
parseInt("2147483647", 10) returns 2147483647
parseInt("-2147483648", 10) returns -2147483648
parseInt("2147483648", 10) throws a NumberFormatException
parseInt("99", 8) throws a NumberFormatException
parseInt("Kona", 10) throws a NumberFormatException
parseInt("Kona", 27) returns 411787
21 years ago
According to Brogden's "Java 2 Sun Certified Java Programmer" exam prep true, false & null are java reserved words. It classifies them as special literal values but they're listed in the same table with all the other java keywords.
Gerry