Richard Strutt

Greenhorn
+ Follow
since Nov 12, 2000
Merit badge: grant badges
For More
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 Richard Strutt

Hi guys,
I passed my SCJP exam today with 93%. I just thought that I would share with you my experience, and what I found useful in preperation.
I have a relatively short programming background. I have only done any serious work with Fortran - a molecular simulation program for my Masters.
I took 3 weeks preperation time. I spent 4-5 hours a night, every night after work, and all day on weekends.
I started by working throught the RHE book in full, making many notes. For me, making detailed notes on every topic certainly helped me to understand.
Next, I worked through Bill Brogden's Exam Cram book. I definitely needed to go through the RHE book first though, because Bill's book is very brief - yet covers everything you need to know in perfect depth. Again, I made many notes, this really did help, just drilling everything into the brain!
I then worked through as many practice exams as I could. The new version of RHE has a good set of exams, although I don't believe them to be quite as hard as the real thing. The exam at the end of Bill's book, however, I would say was easily as hard as the real thing.
Other exams that I believe are particularly close to the standard of the real thing are:
Marcus green's Exams 1 and 2.
Bill brogden's exams - particularly Bills 'Hardest questions'.
Barry Boone's exams.
All of these exams can be found at Maha Anna's page here at JavaRanch: http://www.javaranch.com/maha/_Mock_Exams/_mock_exams.html This is an incredible resource - you should attempt a good selection of the practice exams he links to.
Also, try the Rules Roundup here at JavaRanch. It is excellent for getting your basics up to scratch.
Now on to my actual exam.... what was it like? Well....
* 4-5 questions on IO to start with. These just required you to know the constructors and how you could chain the Streams/Readers together.
* 4-5 questions on Threads. Some of these were really tricky - harder than any practice questions I had had. Although I could eliminate the incorrect answers rather that identify the correct ones.
* Loads of questions on Language Fundamentals. These were hard to identify as 'Language Fundamentals', they were questions about all sorts of things, but where the answer depended on you being able to spot and invalid overridden method access modifier, or a lack of required constructor or something similar. There were many questions where there was just a 'code does not compile' answer. These required particularly detailed reading, but you could usually discount all the other answers apart from 'Code compiles OK'! - So, look very hard for errors!
* There were a few questions on awt. Like what methods a listener defines.
* One easy question on Garbage Collection.
* Some questions on how arguments are passed to methods - i.e. can you modify an object through the reference, what happens when you re-assign it. What happens to primitives in method arguments.
All in all I think that the exam was fair. If you know the stuff in RHE and Exam Cram well, you should have no problem.
If anyone has any questions, feel free to email me or post here. Although I obviously can't give out specific questions that I was asked... as if you'd want me to anyway! That would spoil the fun!
Cheers guys,
Rich.
[This message has been edited by Richard Strutt (edited November 13, 2000).]
23 years ago
Hi,
With reference to the third answer above, if you just kept pumping a Vector full of huge objects, you would, sooner or later, run out of memory. Because the Vector would always have a reference to each one of these objects, the garbage collector would never be able to touch them. Surely this would mean that you would run out of memory..... The garbage collector wouldn't be able to prevent this.
Does this seem like a reasonable reason to mark the third answer as false?
Cheers,
Rich.
Hi,
I'm taking my SCJP exam tomorrow afternoon and was working through some practice exams. I came accross this one on Boones' Exam number 38:
--------------------------------------------------------------
Question 38: What does the following code do?
File f = new File("hello.test");
FileOutputStream out = new FileOutputStream(f);
Create a new file named "hello.test" if it does not yet exist. It also opens the file so you can write to it and read from it.
A) Create a new file named "hello.test" if it does not yet exist. The file is not opened.
b) Open a file named "hello.test" so that you can write to it and read from it, but does not create the file if it does not yet exist.
c) Open a file named "hello.test" so that you can write to it but cannot read from it.
d) Create an object that you can now use to create and open the file named "hello.test," and write to and read from the file.
--------------------------------------------------------------
Now, the first amswer is missing a label, but that's not relavent.
My thinking was, a new File object is created, representing the file. You then create the FileOutputStream using the File object as the constructor. This creates the file if it does not already exist and allows you to write to the file. You are not allowed to read from the file using the code shown. For this you would need to create a FileInputStream using the same file object.
My answer was therefore c as this is the one that matches my answer most closely.
The answer that the answer page gives is:
----------------------------------------------------------------
Question 38: a. The first line creates a File object that represents the file. By creating a FileOutputStream, you create the file if it does not yet exist, and open that file for reading and writing.
----------------------------------------------------------------
Now, for a start, this answer is not answer a, but I guess that there was a mix-up with the numbering. This answer corresponds to the first option.
I had discounted this becasue is says 'write to it and read from it'. I had assumed that the code only lets you write to it.
Any ideas why the given answer is correct - or am I just being picky, or just plain wrong!
Cheers for any replies,
Rich.
23 years ago