File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes SCJP doubt about legal and correct/appropriate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "SCJP doubt about legal and correct/appropriate" Watch "SCJP doubt about legal and correct/appropriate" New topic
Author

SCJP doubt about legal and correct/appropriate

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
HI

I have scheduled my SCJP 6 exam for Nov 14th.

I have prepared well for the exam but i am getting confused about some small things.

Like

I have read from K&B book that

1. volatile and transient variable can be to instance variable only.

2.Nested class can not access the non static member of the outerclass.

3."You must be able to recognize an appropriate or correct implementation of hashcode.This does not mean legal and does not even mean efficient"

I know only non transient instance variable will be synchronized.But it is also possible to declare static variable as volatile or transient.

Nested class can not access the non static member of the outer class directly but it can create an instance of the outer class to access the member.

In the point 3 what is appropriate/correct implementation?Does it mean both followed the contract or not?

can i assume that if the contract between hashcode and equals are followed then it is appropriate and correct?

So in these cases what should i choose?I am confused between the words appropriate/applies/correct to legal/efficient and i am afraid that i could loose my score eventhough i know the concepts well.

Also will all the question be programs or one could also expect one or two theory questions too?

Please somebody help me on this.


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Words like correct / legal are used with things that are obviously wrong. For example Long var = new String(); is incorrect and illegal since it will not compile.

It is 'appropriate' to use generics in new code and introduce it where ever it is applicable. This is usually the context in which the word is used in the real exam.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
S Ali
Ranch Hand

Joined: Aug 23, 2009
Posts: 129

2.Nested class can not access the non static member of the outerclass.


I think you mean static nested class. because a non static one can absolutely access any member of its outer class.

and concerning hash code implementation :
legal -> means compiles fine even if it returned a different value for each object
appropriate or correct -> follows the equals() hashCode() contract
horribly inefficient -> makes it slow for your set or whatever to find the object. For example returning the same int value for every single object which is still legal and correct.
Questions about appropriate and legal use may also include assertions so beware .
May I ask you Siva how you are getting ready these final two weeks because I revised the book and solved two examLab tests and I still feel not ready yet.


SCJP 6
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
I was able to score 80 to 85% from Devaka final exam and that gives me some hope that i will get some good score.

But my first two test on Devaka was too horrible and the scores were not even crossed 50%
S Ali
Ranch Hand

Joined: Aug 23, 2009
Posts: 129
what is 80 to 55 % you took the final exam more than once or what ?
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
sorry that was typo error

What i meant to say was on the 3rd test i scored 80 and inthe final i scored 85
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SCJP doubt about legal and correct/appropriate