Kieren Dixon

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

Recent posts by Kieren Dixon

nirjari patel wrote:Can I run two versions of jre at the same time ? will it create any problem ?



Not sure about your other problems, but for the above question, it's perfectly fine to have two different JRE's installed at the same time.
It won't create any problems unless you're trying to run an application which requires JRE6 against JRE5
Which java version is used when you try to run something will depend on your classpath.
Take note when configuring your classpath to point to JRE5, that JRE6 gets installed into \windows\system32\ so you would need to append a path to JRE5 before anything pointing to the system32 folder.
12 years ago
I found myself referencing a lot of additional material while going through this book.
The following article was useful in explaining rpc vs document for me
http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
12 years ago
search "java clear console" in google and click the first link.
14 years ago
The actual exam is really, really, really easier than the K&B mock exams, so long as you understand the concepts.

Here's my story:
I have not used Java much, only on a few applications, so i did not have much knowledge of the syntax and never used Collections/Generics before.
I read the K&B book at the beginning of the year so i can get SCJP. I made notes on everything that i did not know.
After reading the book i began Uni semester and did not have much spare time so put off my studies for SCJP.
During mid-semester break (2months later) i read the K&B book again, looking over my notes and removing everything i could remember and making some new notes.
I didn't have time to study mocks so i put the actual exam off while focusing on uni work again.

After 4more weeks and nearing the end of uni i made a booking for the exam because i wanted to start applying for jobs and have the SCJP on my cv.
In the two days before the exam day i spent 27hours cramming study in.

I re-read (skimming over) chapters 7-10 because those were the most difficult for me since i have never used any of the topics myself.
I then done the chapter questions for all chapters, this is probably the 4-5th time i've gone over them so i have memorised a few of the answers by now.
Some of the questions i still got wrong though, but about 90% correct from them questions.

I then did mock exam A and B (from K&B) both open book mode and I think i would have achieved about 50%.
I did A, B, A, B open book mode. Second time around i got most of the questions correct.
Then after 5hours sleep and being up studying for the last 11hours i had to do my exam.
86% (62/72)



So as you can see i did not put as much effort in as a lot of other people but still passed with a good mark (even though mark is irrelevant).
The most important thing i would say is understanding the concepts. If you get a (mock) question wrong, make sure you understand why you got the question wrong even if it takes you 10minutes.

I had the promotional second chance offer so i was not too worried about failing when i went in. I understood all the concepts but the thing i was worried about when heading to the exam was syntax, primarily for collections.
However there was only a few collections questions (maybe 4) and i think 1 generic-specific question when i did my exam. Maybe im just lucky though that my weekpoints did not come up.

Don't stress and good luck




Pass by reference VS Pass by value
If static variables are not serialized, then how can they be deserialized?
Here is a good question from Sierra and Bates SCJP Study Guide.
Chapter 4, Question 6.


The value printed is 4.

Index will be 3 after the println() statement.
Yeah... perplexing...

If having:
void go(Integer i){}
void go(int i){}

and calling:
go(1);

Works, then how come it does not with var-args?
It is not asking you to distinguish runtime vs compile time exceptions.

Which are most typically thrown by an API developer

(A) extends RuntimeException and also (C) extends (D) so your reasoning is incorrect.

You can see the "Use" of a class by clicking on Use at the top or bottom of the API page.
Here is the link for NFE
For example in class Integer, public static int parseInt(String s) throws NumberFormatException

If you lookup ExceptionInInitializerError you will see there are no uses.



The question does not state that the methods need to be called sequentially and atomically, just how to safe-thread the class. So E is the correct answer.


No it will not.
It will mean that (assuming both are synchronized) only one thread at a time can be currently executing the code in either of the methods and all the other threads must wait to obtain the 'lock' before calling either method.

However, it is possible to call two methods as one atomic operation, using a synchronized block.



I removed the synchronized keyword from line 23 and added the synchronized block for lines 13 and 14.

If you run this example you will see that the log is written and then the prntln is called. Therefore 1, then 2, then 3, etc lines will be printed for each call.
It will be possible to call the getContents() method from Thread1 while Thread2 has not completely finished writing to the log, thus giving erroneous results.

It is hard to see in such a small program but if you compile something similar to this:



You will note results such as:

1240855661734: Thread-0post this message
1240855669734

1240855661734: Thread-0post this message
1240855669734: Thread-9post this message
1240855677734


Sorry, they looked very similar.

what i thought that there is no object created at all.........i was wrong but need explanation on this. please help.


You are correct, not wrong.
You have probably gotten something else wrong along the way and confused yourself.



So as you can see, there is only 1 object which does not have a reference