Win a copy of Terraform in Action this week in the Cloud forum!

Rajiv Ranjan

Ranch Hand
+ Follow
since Sep 28, 2000
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 Rajiv Ranjan

Can someone please answer this question with a little explanation :
1. InitialContext ic = new InitialContext();
2. Object o = ic.lookup("testBean/TestBean");
3. TestHome th = (TestHome)javax.rmi.PortableRemoteObject.narrow(o,TestHome.class);
4. String result = myTest.userMethod();
5. myTest.remove();
6. // Bean state?
Assume the application server has just been started. At the commented-marker in the client code above (Line 6), in which state is this desired bean?

d) It does not exist.
e) Active
Hi Val ,
They still have 59 question.
20 years ago
Hi Manav ,
May I ask why you disagree with the answers?
Best bet would be to add the modifiers , compile it and see for yourself.
Yes Ash ,
There is still that option which tells you hoe many options are right in mutliple choice questions.
Yes Arvind,
Gridbag Layout is included in the exam.
I think implementing runnable interface is a better way.
One simple reason I can think of is multiple inheritence.If you extend a thread class , you cannot extend any more classes (limitation of Java) but if you implement runnable interface you can implement more interfaces.
I guess this question is discussed in RHE preety well.
I would suggest you to go through this sun tutorial :
It helped me in lot for my SCJP preparation for collections
Hi Rajesh ,
Let me assure you one thing.You will find no ambiguity in the real exam.Questions are absolutely clear and if they need they will clarify the category for exception.
The questions which I got on the exam just tested the flow of code if/if not any exception occured in the programm.You should try and go for al the concepts of exception handling.
Thank you Lusha,
Weel regarding the score, I'l keep that a secret , I aim was just to clear the exam and I am happy that I met my goal.
I am putting my experience and thoughts :
Certification exam is not at all difficult , it just tests you basic understanding of Java.I didn't have a programming background, started learning Java aroung 3 months back and here I am Java certified , even I have apprehensions accepting it.
This site is the most wonderful thing I came across during my preparation.Try looking carefully at all the codes discussed here and trust me you won't find anything new on certification exams.
Do mock test, closest ones are Marcus Green's and Abhilash's . Jxam and Jquest has few good questions too.I just read RHE and some online notes which I got though this site.
Don't forget to print and keep the tread topic : Traps to be aware of in any SCJP test started by Maha Anna few weeks back(I bet if u seach for it u'll find it).
As far as i remember , I got one question on Garbage collection , 3-4 questions on inner classes, 3-4 questions from collection , 4-5 questions from IO , 2-3 questions testing basic knowledge og Strings and String Buffer , 4-5 questions on Exception handling ,3-4 questions on thread 2-3 questiond on overloading/overidding and few very basic questions involving variable declarations.
Though in exams codes might look longer to you , but they are very basic.Trust me there is nothing to worry about long codes.
Once again I'll say: concentrate on basics and stop worrying.Honest efforts never goes in vain.
20 years ago
Thanx to JavaRanch , I cleared my test today.
It was not a very difficult test, I think I did ok.Will be around, if anybody needs any help please feel to mail me.
20 years ago
So Sam ,
Why is that is first case promotion is not made, i.e why char is not promoted to float and comparision is made, as it happenes in second case anyways.

Originally posted by Sam Zheng:
Arithmetic promotion occurs during the comparison.
In your example, the 1st if() will return false
since float "1" is different from char '1'. On the
other hand, the 2nd if() will return true since
123.0f == 123 is a true....the integer "123" is promoted
to 123.0f before comparison occurs.

I totally agree with Saumil, but with the exam point of view I think the most suitable answer is :
just after line 6 (that is, as the method returns)
Yes , it does.
You can write a piece of code and check yourself.
I think the answer is
just after line 6 (that is, as the method returns)
Hi Vijay ,
Let me try to explain this:
The output of the program is
inside method 00
inside method 1010
There should be no confusion about last two lines as they are the output of System.out.println (last two lines of your programm).

Lets take a look at the output :
inside method 1010
This is output of the statement :
int c = b.amethod();
of your programm , as you are calling amethod and it has a System.out.println statement.

The other output :
inside method 00
is because of what you call a forward reference.
When you created a instance of class , by the following statement
bb b=new bb();
the compiler loads the class and tries to initialize the member variable.You have initialized the variable i as
int i = amethod();
as a result of which amethod is called at the class loading time.The compiler sees the statement i==j in amethod , but since variable j is still not initialized it is assigned a default value i.e 0 and hence a output of 00 is printed.
Check the following link for for explanation on forward reference
Hope I have not confused you more.