Philippe Saint-Just

Greenhorn
+ Follow
since Dec 07, 2005
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 Philippe Saint-Just

"Generally speaking, a series of digits with no decimal point is typed as an integer."

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html
lab1:for( ; ; ) { // same as lab1:while(true) {
lab2: while(i++<5) {
[ December 18, 2005: Message edited by: Philippe Saint-Just ]
when f() is declared private in PolyB, any redefinition of f() in a subclass(e.g. PolyC) is not considered to be overriding the private f(). So even though they look similar, java sees them as two different methods that have nothing in common.
"Any exception thrown by the finalize method causes the finalization of this object to be halted, but is otherwise ignored." If there is an exception, you won't see it.

protected void finalize() throws Throwable

check out the API documentation of the finalize() method: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html

[ December 17, 2005: Message edited by: Philippe Saint-Just ]
[ December 17, 2005: Message edited by: Philippe Saint-Just ]
After "case 5's i=5" prints, control returns to the for loop since i>=5. Every time the condition in the while loop is checked, i gets incremented by 1. Finally, when i==Integer.MAX_VALUE get incremented, i==Integer.MIN_VALUE. Since this value is negative, i<5. Which means you enter the while loop, go to the default condition and throw an exception.
[ December 17, 2005: Message edited by: Philippe Saint-Just ]
Actually not always. In the finalize() method you can actually make your object inelligible for garbage collection by reestablishing a reference to it.
- You're not guaranteed every object will be garbage collected.
- You are guaranteed that the finalize() method will run on any object that is garbage collected.
- The finalizer will only be run once for any object -- even if the object has been revived.
[ December 17, 2005: Message edited by: Philippe Saint-Just ]
String s ="hai";
One object is created, the string "hai". Variable s simply refers to it.

String s = String("hai"); is wrong. It should be String s = new String("hai");
Two objects are created. One is the string "hai" as in the first example and the other is a new string that was passed "hai" as an argument.

Every time you have a string in quotes ("xxx"), you are implicitly creating a new string object.
Whether you want to take the test though is up to you. It is true that it is hard to feel confident about this test since there is so little preperation material. If you can wait till January, I recommend you do so and practice with the K&B practice test book.
18 years ago
The vast majority of the questions on the 1.5 exam require you to analyze code and determine:
a) whether it works
b) what will make it work
c) what it will print

Furthermore, most of the behavior of the code hinges on small details; you need to learn to pay attention to these. And the best way to do that is to practice (including using 1.4 resources).
try out marcus green's practice: http://www.examulator.com/phezam/selectsubject.php
this page has two small tests: http://www.javabeat.net/javabeat/scjp5/mocks/index.php?page=mock1

Finally, check out these posts:
https://coderanch.com/t/251920/java-programmer-SCJP/certification/SCJP-Preparation
https://coderanch.com/t/140284/sr/certification/We-Rocked-At-Last-th
https://coderanch.com/t/249842/java-programmer-SCJP/certification/tiger-study-resources
18 years ago
Actually, I started out by studying the scjp 1.4 book by sierra and bates. I read it carefully and did the exams at the end of each chapter serveral times.
Then I read the generics tutorial at http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf. It contains almost all the information you need for that section.

What's really important though is to take as many practice tests as possible. All the information you need for the exam is available on the internet, and the practice tests will let you know exactly what you're looking for.
[ December 14, 2005: Message edited by: Philippe Saint-Just ]
18 years ago
I just passed the 1.5 exam with 93%. This forum helped a lot.

I started out by studying the tutorials available on the sun website, and especially read and re-read the famous generics tutorial. Also the sun API documentation was invaluable (make sure you're looking at the 5.0 version). Finally I took lots of practice exams (thanks to marcus green), including those for 1.4. I found that most 1.4 practice exams focussed mostly on topics that were common to both exams. These will enable you to find out what your weaknesses are and what you might not have learned from general tutorials.
My weakest point on the exam was concerning the API. You NEED to know the formatting classes, the IO classes, the collection classes and java.util.Collections and java.util.Arrays. It is important to know which methods are available to each class and how they work (exceptions they throw, and how they respond to specific arguments e.g., Collections.binarySearch())

Good luck to all

[ December 12, 2005: Message edited by: Philippe Saint-Just ]
[ December 13, 2005: Message edited by: Philippe Saint-Just ]
18 years ago
i++ increments i after it has been evaluated.
++i increments it before it's evaluated.
'new Two();' forces the constructor 'Two:Two()' to be called
'this(2);' in turn forces 'Two:Two(int i)' to be called
the compiler has implicitly placed the statement 'super();' as the first statement in this constructor.
'One ne()' is therefore called and prints "One's Constructor"
The method 'method()' has been overriden in 'Two'. So the call in 'One ne()' is call to 'Two:method()'. This prints out "Two's Method".
'One ne()' returns and we are back in 'Two:Two()' which prints 'i' and then calls 'Two:method()' one more time.
This should explain the output:
// One's Constructor
// Two's Method
// 2
// Two's Method

The statement "new Two(2)" works the same way.