Sandhya Bhaskara

Greenhorn
+ Follow
since Jun 29, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sandhya Bhaskara

Originally posted by Jesper Young:
Congratulations!

Why were you reluctant to take the upgrade exam? The upgrade exam is exactly meant for people like you, who are already SCJP certified and who want to upgrade to a newer version. It covers the same topics as the full exam, and the certificate that you get is exactly the same.

The only real difference is that the full exam is more expensive...





NOT REALLY..both upgrade and full exam cost the same(upgrade used to be cheaper earlier.not anymore)..and that is the reason why I took the full exam even though I had 1.4 certification.
15 years ago
Congratulations!!
15 years ago
I was talking about K&B mocks in my previous post. K&B was the only material that I used for the exam. I went trhough the book 4 times.. Each time I read the book I learnt new stuff that I missed in the previous read.
15 years ago
I felt the mock exams were harder since they do not tell you how many options are correct.
15 years ago
I'm planning to upgrade wcd and bcd too to JEE. Since these are so expensive I'll take them once I get back to work. I stopped working last year for personal reasons. Taking java 6 was a proof that I'm on track with latest technology.
15 years ago
Today I passed the exam and got 93% score. 67/72.

Scored 100% in Flow control,api contents,oo concepts
90& in generics/collections and fundamentals
87% in concurrency
83% in declarations,initialization and scoping


Concurrency questions were hardest of all.
It would have been great if at the end of exam answers explanation was given to wrongly answered questions. I thought I did pretty well in declarations and scoping. Do not know what I have overlooked.

Anyway glad its over!
15 years ago
Will the upgrade have more questions on newly added features? Had anybody taken the upgrade here?
Match not found "A" "C" "E" "F" "G" "H"
Insert element
at index -1 -2 -3 -4 -5 -6

Array elements "B" "D" "F" "H" "J"

Match found 0 1 2 3 4


Consider that an array has the strings "B","D","F","H","J", . If match is found he binarySearch method returns the index of match. So it can return values from 0 to 4 if match is found

If match is not found it will return the index where the element could have been inserted
Eg:"A" is not in the array but the correct index where "A" can be inserted is 0. Since 0 is already valid it will return -1.
Similarly for "C" it would return -2 since "C" should go between B and D(0 and 1 index)
"K" would be inserted after "J" and hence -6(See above).
Basically we can insert an element that is not found either at the begining of array or end of the array or inbetween the array elements.
both cost the same
Is the upgrade harder??
Polymorphism applies only to INSTANCE METHODS.

Reference type decides which class's instance variables are to be used.

Test x = new Test1();
x is of type Test(superclass) . So x.a refers to the instance variable in superclass(3)

If you change your code to
Test1 x = new Test1();
x.a refers to the instance variable in subclass Test1(8)
Ankit,

In your example you were doing a get on stringList .What if you try to add an object to stringList? Even though the reference(stringList) is typed, the actual list itself is not typed.

In short my question is what is the difference between the below two statements

1. List<String> stringList = new ArrayList();
only reference variable is typed

2. List<String> stringList = new ArrayList<String>();
Both the variable and the object are typed


If the above two statements are not the same, how does add works in the first case( I know in the second case compiler makes sure you can add only string objects)

Thank you
Sandhya
Abhinav,

I tried to compile this on eclipse and it did gave me the error. My question was WHY the compiler gave an error when it could have cast the literal 7 implicitly to short and people have already clarified my doubt.

Thank you
Sandhya


shouldn't this be p1.A since we did not import A
List<String> s= new ArrayList();

Is this a valid statement? Will we be able to add any object to s since the type is not specified during instantiation?