Anna Dow

+ Follow
since Jun 04, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anna Dow

Hi, guys,
I wonder how to open a new browser window from the applet (e.g. when user clicks a button)? I remember seeing such thing somewhere, and now I would like to do it myself and can't
21 years ago
Today I passed SCJP with 82%. This is close to my results on Marcus Green's exams (80 %, 79%, 84%).
I was surprised to get so many questions on operators precedence and other basics; in contrary, there was not so much for Collections, I/O and AWT.
Thanks to all people on SCJP forum; it is really a lot of help!!!
21 years ago
I took SCJP today (passed with 82%). I can say that IMO distribution of questions by topics on exam are somewhat different from those in Marcus Green exam etc. For example, I have got a lot of questions on pre/post increment, precedence of operators etc. AWT was quite easy, and so was I/O,
just the basic facts. Also 120 minutes for the exam was barely enough; make sure you take the Tutorial test before taking the real thing so that you will not spend time getting used to exam's GUI.
Good luck,
Hi, Deepali.
I think it's no surprise that the program is stuck. The first thread won't get out of waiting until the second one will call notify(). However, it will never happen, because the second thread is waiting to be notified itself (by the first thread). I think it will work if you move notify() in front of wait():

Sorry, cannot verify it myself - has not got any java environment on my home machine.
I am going to take exam on July 8. I did some mocks and found that my weakest point is AWT API (no surprise since I have no real experience with AWT... do server side development on my job). Could anyone tell me what (approximately) part of exam questions deal with AWT? I mean should I study it really well or some book-based knowledge will do for the exam?
Hi, all, and especially dear SCJPs
I just took Sun sample exam
Made 10 out of 10
Now I wonder: is it of the same difficulty as the real one ? I am really confused about it because I practiced with Marcus exams and did about 80% there
Also: the sample has rather long code pieces; I spend a lot of time just reading and 'parsing' them. Does the real exam also have a lot to read?
You may use variables for case label, but only if they are constants (that is, final). For example, the code:

compiles fine. If you do not decalare j as final, compiler gives error 'constant expression required' for line 1
First equals() returns false because StringBuffer cannot be equal to a String (equals() normally returns false for objects of different types). What's surprising is that second one also returns false. Looking at the class StringBuffer I saw that it does not override equals() method. Thus, equals() in StringBuffer is actually equals() of Object class. Thus, it returns true only for the references to the same object. In your case you have two different objects because of
I believe that's because you close your PrintWriter after the first pass, so nothing is written after that. After moving pw.close(): all input is written to the file.
Sorry, my mistake . I had a space between "+" and "=" in my code:

and that's why it did not compile. Thanks everyone.

Originally posted by Frank Jacobsen:
package p1 ;
public class Super {
protected void say ( String s ) {
System.out.println ( s ) ;
package p1 ;
public class SubOne extends p1.Super { }
package p2 ;
1. public class SubTwo extends p1.Super {
2. public static void main ( String [ ] args ) {
3. p1.Super s = new p1.Super() ;
4. p1.SubOne s1 = new p1.SubOne () ;
5. SubTwo s2 = new SubTwo() ;
6. s.say (" Super ") ;
7. s1.say ("SubOne") ;
8. s2.say ("SubTwo") ;
9. }
10. }
Here the answer is that Line 8 don�t compile why ???
I can se that the methoed in Super is protected, this methoed is inherrit by subTwo class from super , im a littel bit confused, can anyone help me ???

Hi, Frank,
the method say() is inherited by SubTwo, so line 8 compiles OK. It's line 6 which does not. You may find the nice explanation "why" atprotected issues
Hi, Rajeev,
it's strange because on my machine it does not
!!! The error messages for the line "x+=y;" is "illegal start of expression" and "not a statement" Could it be compiler-dependent? I compile in VisualCafe 4.1.
Thanks to everyone who replied to my previous message! One more mistake which I discovered (this one not listed on errata pages): the answer to Chapter 2, Question 4 says that
is legal because x+=y is a shortcut for x= x + y; . Actually, it does not compile. So the correct answer for this question is probably A, E
It's a good tutorial (maybe too detailed for exam purposes but excellent if you work with Collections)
Hi, all,
here is my question:
It looks that if returned true, then the cast is always possible.
(That is, the code like:

will never give a ClassCastException.) Is it true ?
Thanks, Anna