Vishal Gupta

Ranch Hand
+ Follow
since Apr 01, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vishal Gupta

Thanks for explanation Khalid! it make sense, I like it

Best Regards
Dear Mr. Khalid and Mr. Rolf. Its nice to have you here!!

I know this question (which I am going to ask) belongs to "Meaningless drive" forum but I believe it would definitely qualify to be here for promotion period...and hopefully would contribute to the discussion as well as a free book for me

Ok, I would like to know the theme / concept behind the cover page of the book - "three steel sphere on flat shiny surface".... and how is it related to SCJP? (if it is related)


Thanks

* I wanted to ask this question to Kathy and Bert too for SCJP guide - "the thinking man" , ok lets save it for next promotion of their book
** Guys, please don't wait for answer and start guessing
Thanks Devaka and others! I am elevated

Cheers
Source is here

Please see below code




I understand that here we don't need explicit narrowing conversion but why just changing the initialization in next line (Case 2), code is not able to compile. please explain

Thanks

Terence Gronowski wrote:When is there a ClassCastError or a CompilationError? Are there some rules? Are there some more cases as I list below?



Hi Terence, please refer to this thread for casting rules: - webpage

If I have two sibling objects (objects with the same parent) as in #1 there is a compilation error, this means, that the compiler can foresee that something is wrong.



if you apply referencing rule here. ("A reference of type X can point to objects of class X, or to objects of any of X's subtypes. "
then this can be true

now downcasting is required when you assign "reference of type B" (e.g B b) to a "reference that is supertype of B" (e.g a)"
i.e.

and in your case d2 is not a supertype of d1!

It is somehow clear for me, that you cannot cast a Double into a String, but what is the cue behind this?



That is again referencing rule - "if the object pointed to by the reference on right hand side(e.g a) is not assignment compatible with the reference type you are assigning to (e.g b) according to the referencing rule, a ClassCastException will be issued at run time"

and the complete (compiled code) is


I hope this would help..
Hi Sergio, as Ruben and others explained it very well, I am just re-phrasing it again. Essentially you just need to do '3 checks' in order to find out whether a given code will compile/ not-compile or fail at runtime.

Referencing rule: A reference is an identifier with a specific associated type. A reference of type X can point to objects of class X, or to objects of any of X's subtypes.



Check 1 : when assign "reference of type B" (e.g B b) to a "reference that is supertype of B" (e.g a). -> it is Downcasting - must include explicit cast.


Check 2 : if the class you are casting is not a supertype of, a subtype of, or the same type of the reference type that you are assigning to, this will result in a compiler error.



Check 3 : if the object pointed to by the reference on right hand side(e.g a) is not assignment compatible with the reference type you are assigning to (e.g b) according to the referencing rule, a ClassCastException will be issued at run time. Which means code at 'check 1' will compile fine but fail at run time.


Thanks
Congrattts Paarul, greattte score!..dont forget to mention your name in scja wall of fame....what is next..scjp?
16 years ago
Soniya,
Why do you think your profile not impressive!..its brilliant and outstanding considering your experience (just 8 months :roll: !!!)
I think you need start from here -post your resume on different job websites. I know it would be difficult to get a call as you have very less exp but keep trying!
- face few interviews, you will get an idea what are the company expectations from you.
- as well as you can feel/or ask about what type of work you are going to get!
- Do the research about the company, ask your frnds, find out whether its product devlopment or service - based company. Work culture is little different in these 2 types of company (on "general" ground!! not related to specific scenario)

rest of suggestions are good to follow as given by Sunit and Arul! I feel Networking is most imp and useful!!

All the best!
[ August 26, 2008: Message edited by: Vishal Gupta ]
16 years ago
Thanks Guys!
yes Stephen I am targeting SCJP now..
16 years ago
Anand!! its really Commendable!
Congrattts and all the best for your SCJP....
16 years ago
Hiii,
I cleared SCJA with 90% score. Before giving the test I thought I will score more than 90%. During exam all my expectation went down and at one point of time I thought I am just going to pass!!

Thanks a lot to Javaranch, Cameron and all my friends who helped me during my prep.

Here is break up-

Scores:
Fundamental OO Concepts : 87
UML representation of OOC: 100
Java Implementation of OOC: 87
Algorithm Design and Imp: 83
Java Development Fundamentals : 100
Java Platforms and Integration Technologies: 60 (no idea what went wrong!!)
Client technologies: 100
Server Tech: 100

Here is my preparation and suggestions:
I started with Head first java. I would highly recommend this book for beginners as well as for mid-experience Java developer. After completing this book I took SCJA study guide by Cameron. I went through it almost twice. This book is pretty good in terms of OO concepts and UML. (other chapters are also good but I find these 2 are best in context of SCJA ). Other than these two books I studied on net on various topics�went through J2ME pdf, J2EE tutorial (very few pages), hfoo-associateuml.pdf and most important � SCJA objective � read 1-2 times in a day!!!
I had tried reading few topics from SCJP book too to make my concepts clear. I have a feeling that SCJP prep would help in SCJA on common objectives.

After and during studies, I took various mock exams � free and paid one:-
I have posted them in few replies. I am again posting here:-

1)Both Cameron McKenzie's books and mock exams (http://scja.com/)
2)SCJA.de ebook and mock questions (http://scja.de/)
3)uCertify preparation kit and mock questions (http://www.ucertify.com/exams/SUN/CX310-019.html)
4)whizlabs and mock exams (http://www.whizlabs.com/scja/scja.html)
5)Enthuware's trial version and mock exams (http://www.enthuware.com/jassplus/index.html)
6) Sun ePractice 10 questions (https://tmn.sun.com/WLC/Login?cmd=login1)
7) Sun proficiency Test (http://www.sun.com/training/certification/assessment/index.jsp)
8) eJavaguru (10 question) http://www.ejavaguru.com/scjafreemockexam.php

-I haven�t bought uCertify and Whizlabs but I think those are good one.
-I would highly recommend SUN ePractice exam (contain 3 tests of 51 questions each)
http://www.sun.com/training/catalog/courses/WGS-PREX-J019C.xml.
If some of you have attempted SUN proficiency test and not able to find answers. You would get many of them in one of three test here. I cleared proficiency test with 70% and scored 75%, 90% and 82% in Sun ePractice exams.
-Tests from Cameron�s mock exams book and from scja.de were also good. I think these two should be must to start with mock exams

Now the important part about the actual exam � it is really good exam and requires in-depth knowledge of concepts. Some questions are very simple and basic but some of them gone over my head. When I was attempting those few questions I was thinking that I am not ready yet.
I felt like challenged. I should say that till you solve �most difficult question in a world� on a particular concept you should not feel that you know that concept fully. :roll:

And there is no shortcuts
�you have to study
�you have to study hard and
�you have to study all!!

All the best.!!!
16 years ago
1)Both Cameron McKenzie's books and mock exams (http://scja.com/)
2)SCJA.de ebook and mock questions (http://scja.de/)
3)uCertify preparation kit and mock questions (http://www.ucertify.com/exams/SUN/CX310-019.html)
4)whizlabs and mock exams (http://www.whizlabs.com/scja/scja.html)
5)Enthuware's trial version and mock exams (http://www.enthuware.com/jassplus/index.html)
6) Sun ePractice 10 questions (https://tmn.sun.com/WLC/Login?cmd=login1)
7) Sun proficiency Test (http://www.sun.com/training/certification/assessment/index.jsp)
8) eJavaguru (10 question) http://www.ejavaguru.com/scjafreemockexam.php
16 years ago
Anand, I dont see 2 versions of SCJA exam on SUN site. there is only one version 1.0 !!! am I missing something ??

Also I would say that you need to take lots of mocks for this test too. As you already did preparation for SCJP, you should be fine in 3 (Section 1, 3 and 4) objectives of this exam but you do need preparation in rest of exam objectives which might take some time!!!
16 years ago
I took the Sun proficiency test and just managed to pass!!
- as mentioned by Stephen, question 7 doesn't have any UML diagram but we can select the right answer!
- this exam seems tougher than other mock exams I took (which includes Sun ePractice tests too)
- but I feel all questions was within the objective though wordings were little off
- and the most frustating part is you wont be able to know the correct answers...though I tried to play with it (by registering several time or press back button) but its hard...

I would be interested to discuss these questions 'offline'...

[ August 18, 2008: Message edited by: Vishal Gupta ]
[ August 18, 2008: Message edited by: Vishal Gupta ]
16 years ago