aditya chaudhari

Ranch Hand
+ Follow
since Jul 05, 2011
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by aditya chaudhari

Hi Everyone ,

I have passed OCAJP 7 with 78 %.

Thank you coderench forum and all volunteers here for all your quick reply for every question.

Resource used :
1) Mala Gupta's Book which name is: OCA Java SE 7 - Certification Guide
2) Enthuware's Mocks
3) JLS 7
4) this forum questions and answers ,all suggestions

My Enthuware test results are as below :

Starter Test: 63
Test 1: 53
Test 2: 65
Test 3: 69
Test 4: 70
Test 5: 74
Test 6: 72
Last Day Test: 74.


I was preparing for this exam from last 4 to 5 months ,
Initially for 2 month I started with 2 hrs a day, reading study guide spending lots of time coding examples , playing around code.I had just started giving mock exams and i was almost ready to attempt exam.....

but in a meanwhile due to some new assignment at work i cannot give much time for preparation.

A Gap of around 2 months !!, this 2 months i was completely out of OCJP study.
I resumed my study and need to finish everything in just a week!!!

Clear understanding of concepts from study guide helps me . I must say reading JLS 7 helps me though it seems clumsy it clear all concepts.
I got many tips like this on coderench site.
Also Enthuware mock exams helps me, its a complete solution to OCJP certification needs.


To sum up ,
What helps me in to pass certification exam :
1) A reference guide : OCA Java SE 7 Programmer I Certification Guide: Prepare for the 1ZO-803 exam
2) Getting my hands dirty by playing with codes.
3)CODERENCH site blog to get expert comments on each of my question.
4)Enthuware mock exams
5) JLS 7 reading


Thank you again for all members for all your support , teachings and motivation to do certification from each and every post.


Thanks and Regards
Aditya C Chaudhari
India
10 years ago
Hi Roel and Sergei ,

Thank you for your insights.

All codes mentioned by you really very usefull.

I am still playing with that codes and concepts , for time being my question mentioned is resolved.
Ofcource while playing around with code i 'll surly post if any problem i come across.

Roel thank you for additional "Nice to know:" tip it will use this in my future projects to know who all are using memory.


Hi All ,
I have question on class loading when we extend class and when we just use object of class without extending it.

Code 1 :



code 2 :


As per i know class is loaded when we use its object.
Also what exactly happens when we extend class that it gets loaded ( as it prints static block) and not when we use B b =null;...?/

Please tell me where i am going wrong what are rules for class loading.?
Hi Roel and Sergej ,

Sergej ,
You have given useful codes .
your following sentence helps me to understand :

remark: instance and static variable of reference type if not assigned value get null.
If you explicit assigned null value it will have null too.
The example below above line is very informative.


Roel ,
as you metioned :
...In both statements you refer to an element which is null (not initialized).

we can say that here for this example -- "null means the String Object was not instantiated".

i aologize for Typo of below line i was experimenting and by mistake put // comments. part. please ignore below line
System.out.println(names[0][3]); //ptints address of {"AAA","BBB"} array.

Roel i understand (Please corrrect if i am wrong ):

System.out.println(names[3][0]);-- Refers to null at position 0 of String array names at position 3.
System.out.println(names[1]); String array at position 1 refers to NULL.
Hi All,
i have question on multidimensional array following is code :


on line i am expecting address of null or NullPointerException but it prints null.

My understanding is as follows :

why i think there could be NulPointerException
Rule i know : "when we access or Modify the slots of null as if it were an array "--NullPointerException is thrown

Please clear my doubt.
NULL always confused me also please suggest where can i get facts about NULL which are important for Exam as well as java programmer.
Roel and Sergei ,
Thank you for your reply .
I have gone through thread you have mentioned it is appropriate for my questions.

Thank you for immediate replies.
Hi Sergei Zhylinski ,
Great score Congratulations
Thank you for sharing your experience.

I have read many experience and how all study.
But in your post you have mentioned that you have used "JLS 7 ".
you also mentioned that you read JLS as per exam objective.

As its hard to read JLS can you please elaborate your detailed approach on " How you used JLS for OCAJP preparation" ?


10 years ago
Question from Enthuware on operated precedency.

i am confused with explnanation given.
Following code is from Enthuware tests i have just add few extra lines to experiment on concept.


I am expecting && to be evaluated first than || operator ( As per precedency rules here webpage)

ENthuware explanation as below:
There is not just one rule of precedence but multiple rules that are at play here. As per 15.7.1,
"The Java programming language guarantees that the operands of operators appear to be evaluated in a specific evaluation order, namely, from left to right.".

But i dont understand what multiple rules admin talking about.

Please help me to clear my concept.

@ Enthuware : My sole purpose to post this question and forum discussion in this forum is to clear my doubt. I dont have any complaints about Quality and support of Enthuware. If i am violating any rules to use product please let me know i 'll remove this post.
Sergej and Joanne Neal Thank you for valuable reply.

The two things you both have menioned about my doubt.I am summarizing your explanation.


Sergej :
char is unsigned integer and you can use literal as long as it fit in it

Joanne :
You don't assign anything to switch expression , you just compare its value with case labels.


My Conclusion about switch expression and labels.

we actually compare expression with case values in switch block.the value to compare must be literal values.

I have written following program to play around it might help others..

Also please correct me if any wrong i have understood.
Hi All ,
I have a question regarding char and int when use with switch block.

Following code is concept i know about char and int :


But when same concept i try to apply in switch block as below it fails why? what am i missing here?

Please help me to understand this concept.
Also if there are rules which are critical about switch construct please share them.
Hi Gino welcome to forum ,
i think you have missed question meaning. Following is question from mala G book which you mentioned.

Mala G book page 104 section 2.8. Q 2-1
Q 2-1 : Select all incorect statememts :

I guess you miss this incorrect word while reading question.

Now if question is asking to choose incorrect the statement as below :

Gino Fortunato wrote:A value can't be assigned to a primitive variable


is false b'cz Yes A value can be assigned to a primitive variable.

if you have just started looking at certification question be cautious while reading questions.
Happy Coding..!!!
Hi Roel Thanks for 15 questions

I answer all of them correct except No 11th which is as below :


I have 2 questions here
1) as per i know the var args is last choice of compiler when overloading considered ( I may be wrong please correct me if i am )
2) Though var -args not in OCAJP i am curious to know why it is printing Obj address..???
Thank you Matthew for detailed explanation and for one Extra point you teach me ,

The int can be boxed to an Integer, but then that can't isn't compatible with a Long. And the compiler will not convert the int to a long and then box that to a Long ("widen then box"). So that won't compile.



Thank you Sergei Zhylinski for one catchy point as

(since the default for numerics is int)

i 'll experiment on this.


Roel ...I spend a half day on this and come across your post

So I'll just stick to this (administrative) note: autoboxing/unboxing is not on the OCAJP7 exam (it is a topic for the more advanced OCPJP7 exam).

.
Thanks Roel for keeping eye on each small topic we all guys post here and its relevance with Exam Objectives.

Its better just to be aware of autoboxing/unboxing.

Hi Raghav if you have Head First Java book read from that book,This book one of the best to clear beginning concepts...
10 years ago
Hi Sergei ,
Following is explanation .


Hope this helps.

this example is good candidate question for OCAJP 7 Exam.
Thank You for your question.I am preparing for OCAJP 7 Exam.