Kevin McMahon wrote:
I've been asked recently "Is it better to store objects within another object, or store an id which allows us to look up the other object?"
My initial instinct is that presuming the lifecycle of the nested object is dependent on the containing object, nest the object itself. But I realised I couldn't actually explain in clear words why.
Amirr Rafique wrote:Thanks for your reply Embla. I have one confusion in digesting this concept, As per your post what i understood is
1111 1111 1111 1111 1111 1111 1111 1111 => -1
then what will be value of following bit pattern
1000 0000 0000 0000 0000 0000 0000 0001
please explain
Vidmantas Maskoliunas wrote:Another interesting approach is to use java.util.TreeSet<Integer> API. But that may be an overhead.
Campbell Ritchie wrote:The nested loop technique runs in quadratic time, so it is not very efficient, but is almost certainly what your teacher wants you to find.
Aruna Balasuriya wrote:Why ???
Anirban Chowdhury wrote: Would really appreciate if somebody explains me the reason for this,this one certainly looks like a very very wicked SCJP question..
Pradeep Adibatla wrote:
what should be corrected in the above?
Satya Siripuram wrote:is there any API to access private members of a class?
Amirr Rafique wrote:I want to invert the integer value 0 in such a way that all its bits are set to 1. Please help me how to do it?
Christopher Laurenzano wrote:I want to give the CD objects the name CDRecord1(CDRecord1.Artist, CDRecord1.albumTitle, CDRecord2.name, CDRecord2.albumTitle, etc) but I'm not sure how or if I can use that naming method with an Array or an Array List in some kind of a loop to advance to the next record. Can anyone tell me if this is possible or do I have to wait until I read more?
Vishal Hegde wrote:is it necessary because islands of obect is reallly confusing me ??? or let the JVM handle the gc thing???
Mel Ram wrote:I think im suppose to use the linear search method.
I just don't know how to use the linear search method. The example in my homework is not very good in terms of how to use it.
Pradyumna Khadanga wrote:One of the interviewer asked me "How to write a custom Imutable class ?"
For this what is the exact answer ?
santhosh.R gowda wrote:
Is it possible to add different values or objects to the same key of hashmap other than collection or array