Anniruddh Rana

Greenhorn
+ Follow
since Nov 30, 2011
Anniruddh likes ...
Eclipse IDE Chrome Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anniruddh Rana

Thanks a lot Mala for your response,

I wrote to them yesterday and this is the response I have received.


We have requested to process your Oracle Certified Associate, Java SE 7 Programmer eCertificate to the email ID xxxxx@xxx.asd You should allow up to 5-6 working days for processing your eCertificate and 4-6 weeks to receive the hard copy of the certificate.



It is strange that they havent even mailed me a soft copy yet. Awaiting both the soft and hard copy to arrive; will update you folks as soon as I get them.

Cheers,
Anniruddh
Folks,

Need your assistance on this,

I had appeared for the beta OCAJP 7 exam on 9th December 2011 (1Z1-803 Java SE 7 Programmer I) and scored 96%.

I was able to download the examination score report and the logo off the oracle website; but I havent received a hard copy of the certificate or any other communication in the mail address which I had provided for correspondence.

Requesting guidance to seek the same; it would be helpful if other people who have received their package could tell me what are the contents and also guide me in getting my package.

Regards,
Anniruddh
Hello Kevin,

Kindly go through the java tutorials for the requested topics, I hope these will prove helpful for your preparation.

Java Operators: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html

Enhanced for loop: http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html

Loading a resource bundle based on locale : http://docs.oracle.com/javase/tutorial/i18n/resbundle/concept.html

Regards,
Anniruddh
12 years ago

Winston Gutkowski wrote:
Seems reasonable, and I think Annirudh has probably covered your error.
However, the underlying issue is that an ArrayList is not really a great collection for this type of logic; a HashMap would be much better, viz:

Winston



I believe you meant a HashSet as mentioned by Darryl (HashMap.put takes a key value pair as arguments), moreover HashSet is backed up by a HashMap

He/She would still have to override the equals and hashCode methods as mentioned above, else the HashSet will not be able to determine that two Person objects having the same name are actually equal(as their hashcodes would be different and hence would get stored into different buckets in a hash backed data structure)
12 years ago
if by "s" you mean a numeric literal like 2; then I am afraid to say that you can only assign values to variables and not literals.

eg: int size =2; works because size is a variable of type int, so you can assign it a value of integer literal 2.

But since 2 is not a variable you cant say 2 = size;

alternatively.

If you have two integer variables;

int s = 0;
int size =2;

then you may very well go ahead and write s = size; OR size =s;

provided both of them have been declared above.

Kindly elaborate the question if my understanding is wrong.

Anniruddh
12 years ago


Change that to



and give it a try.

i.e. use System.out.print there instead of System.out.println
12 years ago
Hello Haani,

The issue with your code is that



The above code snippet occurs inside the for loop

So effectively, each time you find a person with a different name you add another person with the entered name.

eg: You entered Harry 1st .. array list had size =0, after entering Harry it has size=1
Now you entered Sue .. array list size was 1, got incremented to 2.

Now next time around you enter Sue again, this is how the for loop will work

size of AL = 2, so the loop variable "i" will have the values 0 and 1

element at index 0, name = Harry ... does not match Sue ... go to else block, insert Sue at index 2
iterate again

element at index 1, name = Sue ... found Sue, book assigned.

So even though you had Sue in the ArrayList earlier you ended up adding her again, the arraylist would look something like this {Harry, Sue, Sue}

instead you can use a boolean flag:



Apart from your use case. the arrayList infact the Collection interface has a contains method, which checks if an object is contained inside the collection or not.

The implementation of an ArrayList's contains method uses the equals() method from the Object class to evaluate if the object is in the list or not.

This is what you could do

In class Person... override the equals and hashCode method.


Next as soon as you get the name input from keyboard. do the following.



As you may have found out I havent tested this code inside any IDE so there might be some syntactical errors in the code, kindly ignore

Hope this is helpful
Regards,
Anniruddh
12 years ago
@Abhay and @Ankit:

I already did post my review ... but needless to say as I mentioned earlier I wrote the OCA java 7 examination and not the OCJP so I am not sure if this is going to help you folks or not.

You may follow the OCA review discussion at the following thread: https://coderanch.com/t/561069/java-SCJA/certification/OCA-Java-SE-Review-Not

Edit: Thanks for the luck

Tina Smith wrote:I took the exam today as well. I wouldn't say the questions are hard, but you have to know your basics, know them well, and read the question through twice. I only caught two questions that refer to something new in Java 7.

The outline on Oracle's site covers pretty much everything on the test, I don't think they've taken broad interpretations with their exam objectives. Questions were multiple choice, single or multiple answer. You are given the number of correct answers. (always handy - I hate those exams where you're given choices from a to i and "select all that apply")

I was expecting some questions on how to compile java from the command line (from the Java 6 OCJP forum it sounded like this might be something to know), but it's not on the exam objectives. Also, no JDBC or Locale questions, but they have to save something for the OCJP exam (especially since it's highlighted in the upgrade to OCJP exam).




Just came back from the examination center, I would concur with you Tina, that the questions weren't difficult if you know your basics well. I had 3 questions related to Java 7: 2 w.r.t Switch and one with diamond operator (type inference); and all the questions had choices underneath (felt like I was on the hot seat of who wants to be a millionaire).

My exam set did not have any questions w.r.t Resource bundle Or JDBC.

What it did contain were questions on scoping, String builder, String equivalence, inheritance, de-referencing, arrays, ArrayList (do go through the java doc for AL), method overloading, overriding, encapsulation and definitely Exceptions.

I believe I received the same exam set as "R Hoefer" above (should have bribed you for some questions earlier :P)

In the end it was fun, I hope OCJP 7(1z1-804) is the same whenever it releases.

Looking forward to writing the same in Beta

Anniruddh
12 years ago
Thanks a lot Hoefer,

I think this information will come in handy for my OCA examination tomorrow, I just hope there isnt much of inner nested classes etc.

The only books I have referred to for Java are:
The Java Programming Language by James Gosling
and
Java Puzzlers by Joshua Bloch

I have a couple of years of experience in core java to back myself up. But for the last couple of years I have been working mostly on JSPs.

Hope to share my experience with you folks soon enough

Anniruddh
12 years ago

Abhay Agarwal wrote:I am now able to reschedule my Java 7 Upgrade exam (1z1-805) on PearsonVue website beyond 17 Dec 2011...

@Anniruddh Rana - I am not aware of date when results of exam will be declared. By the way, have you appeared for the exam already ? If yes then please share your exam experiences with me.

~ abhay agarwal



Wow thats great...

The results would be announced approximately 11 weeks after the closure of the beta exams, I haven't appeared for any of the beta exams yet.

My OCA J7 beta is scheduled for tomorrow so wish me luck

Anniruddh

R Hoefer wrote:I took this exam today. I didn't have any questions on the JDBC API or Locale class.



Hello Hoefer,

What was the format of the questions, were there are descriptive questions where-in we have to write answers or only multiple choice and drag-drop?

Did the exam consist of 120 questions? According to you what was the level of difficulty and if possible could you give us an example of the principle upon which the tricky questions were based (Example and not the question).

And as usual any other information that you think would help us will be useful.

Regards,
Anniruddh
12 years ago
Hi Folks,

I stumbled upon a fellow netizen's blog and found out a review of the beta OCAJ 7 exam.

Kindly follow the link to visit the post.

I hope this proves helpful for others aiming at OCAJ 7.

Regards
Anniruddh.

PS: It will be helpful if other interested developers who have appeared for OCAJ 7 may add their reviews below if they feel like or as a comment at the blog
12 years ago

Abhay Agarwal wrote:Beta exam end Date for Java 7 Upgrade(1z1-805) is now 7th Jan 2012.



This means the results will be delayed by another 3 weeks as compared to the previous date.