Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCJP doubt about legal and correct/appropriate

 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
S Ali
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is 80 to 55 % you took the final exam more than once or what ?
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry that was typo error

What i meant to say was on the 3rd test i scored 80 and inthe final i scored 85
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic