hamada yam

Ranch Hand
+ Follow
since Oct 10, 2013
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 hamada yam

Thanks, for exam purpose should i use openJPA 2.0 as an implementation in order to get the same behavior as mentioned in JPA specification?
Don't bother about wrapper classes so much, try to concentrate and improve your performance in exception handling, garbage collection and array initialization. Also aim to score much higher in mock exams and revise your mistake, try to make a note why you made such and such mistake.
Comparator and Comparable are quit important from point of view , so also pay importance towards there method signature and valid return type. Both are use to compare objects.
Comparable is used to define natural ordering for the objects whereas comparator is used to provide whatever ordering you want for objects.
For e.g. let say you have created a class MyOddNumber and you as the author of the class want that objects of class MyOddNumber will be be compared in ascending order so for e.g. 1,3,5,7,9, etc .So in order to achieve this you will implement Comparable.
But now let say some other user A want to compare objects of class MyOddNumber but in descending order so for e.g. 9,7,5,3,1 , then he can use Comparator. Another user B wants that objects of class MyOddNumber will be compared in such a way that odd numbers should be in ascending order as well as multiple of 3 [/bf]or e.g. 3,9,15,21,etc.
As you can see thanks to Comparator we can change the natural ordering of the class without modifying the original class and define non-natural ordering
Just to be sure as i read this thread and some other threads , it seems the best resource to prepare is ProJPA 2 edition 1. My preparation goal is
1. Finish the Pro JPA 2 book, by coding and modifying the examples.
2. Take enthuware mock exams.
Is it enough to prepare for the exam or should i also read JSR sepcification ? Moreover chapter 3 of Pro JPA talks about EJB stuff , is it relevant for the exam? or should i skip this chapter completely and move to chapter 4?
It's mentioned in the JPA spec 2_0 that an entity must have a no-arg constructor and it should be public or protected. I changed the visibility to private and everything(persistence logic) works fine. I am able to save and retrieve object without any warning/error. Why so? I am using Mysql and hibernate 4.3-6.Final as JPA provider. The same goes for final class , i made my Entity final and it still works.

But if i call clear() method on em , and perform some action on entity then i get Runtime exception related with private constructor

Can someone please explain why the code above behaves like this?

Himai Minh wrote:You can read EJB 3 in Action (2nd edition) to learn the theories. But most exam material is based on JSR 318 specification.
Most people recommend EJB 3. 1 Cookbook and EJB 3.1 by Oreilly.

The example code of Chapter 2 of EJB 3 in Action does not work. See this forum http://www.manning-sandbox.com/thread.jspa?forumID=731&threadID=67353
I decide to read the theories of this book before I start reading the EJB 3.1 Cookbook to learn the coding part.

You will find Ivan's example code and study guide from this link http://www.ivankrizsan.se/my-books/

EJB 3 in Action covers topics like CDI, Application Context Container, Aquallian, JPA, web services and etc. Those topics are not on this exam. This book is not for this exam.

For the exam, read J2EE tutorial (The EJB part), Frits' notes and Ivan's notes.

Thanks, so i should use JSR 318 specification to learn theory but which topics should i pay most attention to. The specification consists of 600+ pages and does all parts are relevant for exam takers or some parts are for vendors who will implement the specification? To practice coding Ivan's study guide will be sufficient ?
Going through EJB spec is kind of dull and i personally like to prepare for exams by coding some examples and modifying them. Is EJB 3 in action (2 edition) http://www.manning.com/panda2/ enough to prepare for this exam. Does it covers all the topics mentioned in the exam with sufficient details?
I cleared the OCPJP 7 and would highly recommend the oracle tutorials http://docs.oracle.com/javase/tutorial/extra/certification/javase-7-programmer2.html. And remember the mantra "Code, code and code".
Thanks so just to be sure i can now take expert level java certificates like 1Z0-898 or 1Z0-895 because all what is required to have is OCPJP 7. Moreover, is it worth the time to go for OCMJD , i mean 6 months is a lot of time and also there is mandatory training which will for sure cost a lot
For the exam we need to study from edition1 or edition2
I passed OCPJP7 and was looking to go for next certificate at http://education.oracle.com/pls/web_prod-plq-dad/ou_product_category.getPage?p_cat_id=267#tabs-3 . But i see exam only for java 6 but not for java 7. Is OCPJP 7 equals Oracle Certified Master, Java SE 6 Developer or Oracle has removed the master level exam for Java 7?
Moreover it would be nice if someone can provide few details about how OracleCertifiedMaster is different then OCPJP 6 or 7
Passed OCPJP 7!!!
5 years ago
If we pass the OCPJP 7 then does the final percentage (marks that we scored during the exam) count's or published anywhere? I mean does it make any difference from the point of view of certification value that if we pass it with 100% or 90% ?
The cast is ok because you are testing for non-final class and at runtime some derived class of P may implement the interface R .
for e.g.

but if you declared your class P as final like

So in a nutshell for final class the compiler is sure whether the class implements interface or not but for non-final class compiler cannot be sure and that's why cast is allowed.

A java file can have multiple classes defined but only one public class.