This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Sharmili Rameshbabu

Greenhorn
+ Follow
since Jan 14, 2015
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
45
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sharmili Rameshbabu

Roel De Nijs wrote:Don't forget to add your name to the OcajpWallOfFame.



Done!


Roel De Nijs wrote:Probably this one.



Correct! Thanks for finding it.
5 years ago

Prathima gaitonde wrote:Congratulations!!!



Thank you! Just read your post, Congratulations to you too!
5 years ago
Hello All,

Yesterday I cleared the OCAJP7 certification with 90% score
I would like to share my experience here so that it benefits someone out there who has not yet taken the test. Proud to tell that i have learnt at least some small thing from all the topics discussed over here.

Resources used: Oracle Java Documents, Enthuware, Java Ranch forum.
Time spent: Four months

Oracle java Documents:
I came across this Oracle Java Documents link online when i was searching for the SE7 material, and i liked the way the concepts are explained here, it is very crisp and has topic wise explanation on the exam objectives. When i finished reading those lessons i really felt i need something to test my knowledge.
That is when i got to know about Enthuware, there were wonderful feedback about the software, liked the trial version and decided to buy it.
I purchased the software in Nov,2014 and later i got to know why people have given such a wonderful feedback about it.

Enthuware:
I began giving the tests. Now i would like to point out what not to do when using this software! Do not hurry and finish all the mock tests if you do not have a good progress! Your aim should be to score 80% in them because in most of the discussions here it is pointed out that if you are scoring 80 and above in Enthuware mocks you seem to mostly likely clear the exam with good scores.
I am pointing this out because i made this mistake these are my scores:

Test 1-12 November 2014-39%
Test 2-19 November 2014-59%
Test 3-26 November 2014-67%
Test 4-4 December 2014-64%
Test 5-11 December 2014-67%
Test 6-20 December 2014-71%
Last Day Unique-10 January 2015-74%

And i was not serious about how i wrote these exams, as far as i remember finished first four tests in 1 hour or so.
After my last day test only i started reading the discussions in this forum and understood am not yet ready for the test but already ran out of my mock tests
So please do not take these mock tests so easy and finish them off! For my own satisfaction rewrote the first two tests and passed them.

What to do if you have already committed the above mistake?? (Read below)

After this for few days i started reading all the topics discussed in this forum under OCAJP7 and trust me i learnt a lot of small tricky things here. There are very beautiful and nice explanations in this forum which makes you understand things better.
In one of the discussions (I do not remember the exact thread ) , someone talked about the Leitner mode in Enthuware and that is when i understood the purpose of it and this is one of the ways to go through all the questions at least once!
I made a maximum use of it by ensuring i do not have any questions in Unlearned or Level 1 category.
Though your memory helps you find the answer, you get used to the concepts very well. It gets into your mind.
And one more suggestion, Adding notes in the software really helps to revise on the day of the exam.

Enthuware has good supporting team, for all my queries i had always got response from them very quickly.

On the DAY of the exam:

Had a good night's sleep and in the morning revised my own notes and the notes i had taken in enthuware.
During the exam, I was left with twenty minutes and nine questions for review. Reviewed them in ten minutes and spent remaining time in checking other questions.

I would like to tell:
1.Do not finish off your mock tests in hurry, because this is the best way to evaluate your learning and progress.
2.Make full use of Enthuware.
3.All the best for those are going to take test, Be confident.

Finally i would like to thank all the volunteers here who are doing an amazing job by spending their time in solving the doubts of Greenhorns like me! Kudos Team!!
I would like to learn more and more from this forum. After a small break will start to prepare for OCPJP7!




5 years ago
You can easily know the number of objects created in the code. Number of objects=Number of new keywords!
So the answer to this question can be only less than or equal to three.
Many thanks Roel and Sergej for the response.

Now its very clear, i have understood where i was going wrong.
Am just curious to know how a=a--; or a=a++; works in the below code.



1.In case of b=a++; it is interpreted as b=a; and a=a+1; then a=(a)--; or a=a-- should be interpreted as a=a; a=a-1; and line1 should print 1. But why it is not happening? Please advise.
2.line2 also does not increment the value of a. Why?
Thanks a lot for quick response.

Roel De Nijs wrote:

Sharmili Rameshbabu wrote:1. If the value of the instance variable story was in the range of -128 to 127, then there are no objects created for it. Right?


You are referring to the cached values. So when the 1st instance of CardBoard is created a new instance of Short (with value 200) will be created. On every next instantiation of CardBoard, this instance will be used (and thus no others will be created).



(with value 200)??? I meant to ask if it was say Short story=1; then there are no objects created in heap, since they are created in cache and referred by all the instances of the CardBoard, So answer to the question would be just 1 object(c1) eligible of garbage collection. Correct?
I have few doubts regarding this topic. Can you please address them.

1. If the value of the instance variable story was in the range of -128 to 127, then there are no objects created for it. Right?
2. if line 1 is added in the below code , then object referred by story is not eligible for garbage collection. Right?


3. If line 1 is modified as short s=c1.story; does the behaviour is same as the previous one?
4. If a class has a static member variable, they are never eligible for garbage collection till the program terminates. Right? As in this example


Please correct me if am wrong, am writing this to ensure my understanding.
Thanks Roel! Even i thought about the bit length of both the data types, its weird! and explanation from the same link goes as below.

A widening conversion of an int or a long value to float, or of a long value to double, may result in loss of precision - that is, the result may lose some of the least significant bits of the value. In this case, the resulting floating-point value will be a correctly rounded version of the integer value, using IEEE 754 round-to-nearest mode (ยง4.2.4).

This link from oracle docs also mentions long can be widened to float or double

Roel De Nijs wrote:

And a reply of me would not be complete if I didn't have a few pop quiz questions So here we go:
1/ can a long be widened to a float?
2/ can a byte be widened to a char?
3/ can a char be widened to a short?
4/ can a char be widened to a float?



What i have answered when i saw these questions are
1/true
2/false
3/false
4/true

Prathima gaitonde wrote:
1>Long can fit only in double



I tried the following code and call with long argument actually calls the method with float parameter.


output is float. So it means long is widened to float. Is it not?

Roel De Nijs wrote:
Spot-on! Although you made a little slip-up in your explanation: As byte range is -127 to 128, value 200 is too big to fit into byte



Isnt the range of byte -128 to 127??
And I found this link useful to have the overview of the conversion rules, Thanks to Paul.

Especially the tables Table 5.1. Casting conversions to primitive types and Table 5.2. Casting conversions to reference types brings all the concepts together.

Roel wrote: In this post is explained why you get true (instead of false). You are comparing a primitive and a wrapper using the == operator, so the wrapper will be unwrapped/unboxed and thus you compare 2 ints, both having exactly the same value (8).



I completely agree to this, but i was misguided by the fact that when we use a new keyword, the integer cache is not used. So


creates a new object in heap and


is seen as Integer j=Integer.intValue(8); and uses the cache. So the references are different and hence i thought i==j should print false.

To be frank, am reading this complete thread for the third time and am able to convince myself for true as well as for false!
Can you please tell what is happening here..


I was expecting this to print false but it prints true