Pritish Chakraborty

Ranch Hand
+ Follow
since Jun 12, 2012
Pritish likes ...
Firefox Browser C++ Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
9
Received in last 30 days
0
Total given
8
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pritish Chakraborty

The question is asking you to make a class which defines some collection (which collection is to be used, I am leaving to you), such that an object of Items class is mapped to different String IDs, the variable identifier of which is 'buyer'.
Hello all

Having passed OCPJP 6 a few days earlier, I was curious regarding the SE 7 certification. A lot of people are saying that the exam is still in beta stage and is really tough.

Considering that the Developer cert can only be attempted by me when I'm supported by a company and am actually working, I thought of the SE 7 cert as a possible next target.

As per topic title, I want to know what differences there are between the upgrade and II exams. I would think that OCPJP 6 and OCA SE-7 Programmer-I are nearly the same; they cover the basics and gotchas of (mostly, in the latter's case) Java SE 6.

Still, the upgrade exam focuses only on the newer features. Some people also mentioned how questions are sometimes not given according to objectives.

I would suppose that this makes it a highly dangerous, yet highly prestigious exam to give. Opinions?

Also, I found this resource for OCPJP 7 : Study Guide for OCPJP7. It's not much but it's all we have at the moment.
Let me clarify this confusion once and for all.

My reply to the OP's query was with respect to the code fragment he posted. He asked why it is wrong.

I answered why it is wrong.

The quote of my post which you have put in </code> tags was asked to you : because you were stating the obvious, and not answering the OP's query.

You were informing me what IS-A and HAS-A relationships are about, whereas the thread had gone in a completely different direction and had already been resolved.
My dear sir, with all due respect, I did read the question. I don't know if you did however.

The original poster was asking why the fourth fragment was wrong.

And it is wrong because the HAS-A relationship of Floozel and Floozet is NOT maintained, which is required as per the question.

It does not hurt to reread the query

Yes, we know option 4 is wrong. He was asking why it is wrong.

Good day to you, sir.
I'm sorry, I didn't get you....

Of course those two points are very clear but here Floozel and Floozet are two interfaces linked through inheritance, not through composition.

How does the HAS-A relationship come into question at all?
Follow the flow control, Kedar!

You throw an exception in the try block, which is silently caught by the catch block.

The catch block then rethrows the exception. Now either it will move up the call stack (out of main()), or it will be caught again.

But in the last fragment of code, a finally block is placed. A finally block runs regardless of whether an exception is thrown. In this case the exception *is* rethrown from catch, and is 'caught' by finally, which forcefully executes. I always considered finally as an offshoot of the catch(...) clause in C++ but let's not go there, finally has some fundamental differences.

Now if we rethrow from finally, the exception is thrown out of main() and is caught by the JVM, which prints the stack trace after halting the program execution.

Now try this - don't throw a new exception from finally. Post the result.
Welcome to the forum!

Please be more specific...post an example and tell us what you are not able to understand.

We will help clarify everything!
Kedar, you need to reread that portion...

String s = new String(str) creates a String object on the heap with that value and also places the same value/object in the String literal pool. If already present, it does not need to place the value, and I do not know what it does then.

String s = str places the value in the String constant pool if it is not already there or redirects the reference variable to the same, if it is already present. Thus only one object is created, and *not* on the heap.

Your resilience is admirably outstanding, Kedar, but surely a forum Bartender would have some amount of knowledge, K&B not withstanding? :P
Well, the only tip I can think of is that the actual exam will be much easier.

60% on Devaka's exams means that you command respect from my side I could only score 52% max :P

Concurrency questions would include, for example, the usage of start() twice (which leads to an exception), how to start threads using anonymous class arguments, etc. I didn't really get a synchronized block logic question on my exam, come to think of it, neither deadlock....but don't let your guard down. I was extremely lucky in this regard.

Generics questions will include compilation with warnings, type safety using the wildcard, generic classes and method declarations, etc.

A good garbage collection question I got said that in a class GC which owned an instance variable of itself, in one of it's methods we were creating Object instances and nullifying GC references. I had to think of it as if some imaginary reference was already referring to *this* GC instance, and that got nullified/reassigned. Just make diagrams for that and you're good to go.

All the best!
Now I'm confused Nitish...

I suppose toString() will be called implicitly and the object's unsigned hexadecimal ID of sorts will be printed, in your code.

But does the same happen in assertions?
You should read the Overloading with Boxing, Widening and Varargs section.

The compiler will indeed box the integer first, seeing that there is no most-specific method which takes a primitive int.

Now the compiler has the option of widening to Object (Integer extends Object via Number) or using the varargs method.

Widening beats varargs because pre-existing code should function as it used to.
The object won't be referable by a live thread and so is eligible for garbage collection, but that does not change the fact that it is an object still living on the heap.

That is enough to satisfy the compiler. You don't need to be able to refer to the object.

When you read about GC in K&B, 'lost' implied that no live thread could access the object (meaning we couldn't).

But that did not mean that the object was destroyed.
Because Floozel does not HAVE-A Floozet.

Here it IS-A Floozet.
I'm not too sure about wait(), notify() and notifyAll() not being there.

I think I did see a couple of questions on wait().

Study them anyway, because they are crucial to concurrency problems.

Varargs is very much present, and to confuse you more, varargs will be asked as syntactical checks or in overloading method-matches.
Devaka's ExamLab

The setup for ExamLab is not present on Devaka's website because the links are broken. I found it and uploaded it to my mediafire acc so here you go.

At your current state, take 2 ExamLab exams and all of the Masterexams if you wish.

On the day before the exam, review your notes and the 2min drills at the end of each chapter.

@Nitish : I suppose you're right about the excess baggage Oracle has included...it's a pity.
11 years ago