This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparable interface,Cloneable interface compareTo() method and sort method

 
shweta patiljadhav
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

For OCA SE7 exam these things are there in syllabus or not? - Comparable, Cloneable interface, compareTo() method and sort method? what type of questions are expected related to these?Thanks in Advance.
 
Sergej Smoljanov
Ranch Hand
Posts: 467
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
compareTo() method and sort - this ones in OCJP not OCA.
Comparable, Cloneable i have no question on this topic but may be ones that question about inheritance.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shweta patiljadhav wrote:For OCA SE7 exam these things are there in syllabus or not? - Comparable, Cloneable interface, compareTo() method and sort method? what type of questions are expected related to these?

These topics are not on the OCA exam. I would be very surprised if you have a question about one of these topics on the actual OCA exam.

The Comparable interface, compareTo() method and sort() method are on the OCP exam, the Cloneable interface is also not on the OCP exam.
 
shweta patiljadhav
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Sergej and Roel....

One more question I have, as per JAVA SE7 we can't add static method in interface while in SE 8 we can add(is it true?)
.....I am preparing for SE7 , so during exam what to consider?

TIA
Shweta
 
Sergej Smoljanov
Ranch Hand
Posts: 467
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JLS 7: 9.1.4. Interface Body and Member Declarations
InterfaceBody:
{ InterfaceMemberDeclarationsopt }


InterfaceMemberDeclaration:
ConstantDeclaration
AbstractMethodDeclaration
ClassDeclaration
InterfaceDeclaration
;

that mean that you can have inside interface only AbstractMethodDeclaration, also:
JLS 7: 9.4. Abstract Method Declarations
It is a compile-time error if a method declared in an interface is declared static, because static methods cannot be abstract.

that mean that inside interface you can`t declare static method. this for OCA 7 (803 exam)

that differ for Java 8 for which:
JLS 8: 9.1.4. Interface Body and Member Declarations
JLS 8: 9.4. Method Declarations
 
shweta patiljadhav
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much,

how is Oracle's material for preparation of JAVA SE7 ? what is default method in Interfaces? it is there in Oracle documentation
webpage

but if I google it, it is in JAVA SE8 .....

 
Sergej Smoljanov
Ranch Hand
Posts: 467
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
default method absent in Java 7. Online tutorial mixed versions for preparation. In collection lesson you also find lambda that not for java 7.
Also want inquire why you want go to OCA 7 and not for OCA 8?
For upgrade you spend additional money, one reason for example go to OCA 8.
 
shweta patiljadhav
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Seregej,

I saw that OCP is not available for SE8 , and I don't have any study material for SE8, I liked Mala Gupta's book and it is available for SE7.....is there is huge difference between these 2? I have completed reading syllabus for SE7 now, will that help me if i want to prepare for SE8 now? I am thinking of taking one certification just to show that I know JAVA ...as I have changed country and my basic degree is not from this country where I live right now...and I am stay at home mum....

Please guide,
Thanks
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shweta patiljadhav wrote:One more question I have, as per JAVA SE7 we can't add static method in interface while in SE 8 we can add(is it true?)
.....I am preparing for SE7 , so during exam what to consider?

If you are preparing for OCA7, only constants and abstract methods are allowed in an interface. Default interface methods and static interface methods are not allowed in Java 7. Because you are taking a certification exam which is validated against a specific Java version, you have to answer the questions accourding to this version. So if you get a code snippet with a default interface method and you take OCA7 exam, you must choose "compilation fails" option. But on the OCA8 exam, the correct answer will be "compiles successfully".
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shweta patiljadhav wrote:how is Oracle's material for preparation of JAVA SE7 ? what is default method in Interfaces? it is there in Oracle documentation
webpage

but if I google it, it is in JAVA SE8 .....

Like I already mentioned in my previous post, default interface methods and static interface methods are a Java 8 language feature and are not allowed in Java 7.

If you are using the Oracle tutorials to prepare and study, you should be very careful. These tutorials are updated to match with the most recent version of Java (which currently is Java 8) and that could (as you already have discovered) be different from what's allowed in Java 7. So you should always use a study guide for the OCA7 exam (or use Google or this forum) to confirm a given language feature is allowed in Java 7; otherwise you might answer questions incorrectly on the OCA7 exam.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shweta patiljadhav wrote:I saw that OCP is not available for SE8 , and I don't have any study material for SE8, I liked Mala Gupta's book and it is available for SE7.....is there is huge difference between these 2? I have completed reading syllabus for SE7 now, will that help me if i want to prepare for SE8 now? I am thinking of taking one certification just to show that I know JAVA ...as I have changed country and my basic degree is not from this country where I live right now...and I am stay at home mum....

Here you'll find a mapping between the OCA7 and OCA8 exam objectives. So if you studied for the OCA7 exam, you'll need to study a few additional topics to be prepared for the OCA8 exam.

In this thread you'll find an up-to-date overview of all available resources for both the OCA7 and OCA8 exams.

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic