Win a copy of The Career Toolkit this week in the Jobs Discussion forum!

Kunal Mehrotra

Greenhorn
+ Follow
since Jan 16, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kunal Mehrotra

As per Amazon, following people are covered in this book:

Rod Johnson, Inventor of the Spring Framework
Adrian Colyer, Pioneer of Aspect Oriented Programming Tools, Project Lead of AspectJ
Java Posse--Tor Norbye, Joe Nuxoll, Carl Quinn, and Dick Wall
Chris Wilson, Lead Architect of Microsoft Internet Explorer
Nikhil Kothari, Architect of ASP.NET AJAX
Hani Suleiman, Author of "The Bile Blog"
James Gosling, Father of Java
Kohsuke Kawaguchi, Creator of the Hudson Continuous Integration Tool
Herb Schildt, The World's Bestselling Programming Author
Floyd Marinescu, Co-founder of ServerSide.com; Founder and Lead Editor of InfoQ.com
Andy Hunt, Co-founder of the Pragmatic Programmers
Dave Thomas, Object Oriented Software Pioneer
Max Levchin, Co-founder and Former CTO of PayPal
Libor Michalek, Co-founder of Slide.com
Weird Al Yankovic, The Programmer's Rock Star

If this is the complete list of the interviewees, then isnt the list a tad Java/Web focused or is it done on purpose keeping in mind the web developers as the target audience?
12 years ago
Hi all,

Could anybody please let me know if the result of SCJP exam is relative(percentile) or absolute(percentage)?

Thank you,
Integers in java are 32 bits signed integers.
So range is from -2^31 to 2^31-1

2^31-1 is the biggest positive int value, so in binary a zero (sign bit) folowed by 1 :
0111 1111 1111 1111 1111 1111 1111 1111 (binary)
7fffffff (hexa)

-2^31 is is the lowest negative int value, so in binary a 1 (sign bit) folowed by 0 :
1000 0000 0000 0000 0000 0000 0000 0000
80000000 (hexa)
--------------------

Seb, I couldn't understand your explanation for the lowest negative number...

I would rather have the explanation this way :

Since the compiler stores a negative number in 2's complement, I would rather add 1 to MAX value and then get its 2's complement to get my lowest negative int value.. that is,

1) adding 1 to 7fffffff(MAX) --> 80000000
2) getting 2s complement of 80000000 --> 80000000(MIN)

its like if a range of a number is from -6 to 5, then to get a binary representation of lower range add 1 to upper range and then get a 2's complement of the resultant.

my 2 cents!
Kunal

P.S: Please feel free to share your comments around my explanation.
Hi Srikanth,

What I understand ( and people please correct if I am wrong) is first the byte number is promoted to an integer. In this process, -64 erstwhile represented as 0xc0 would now be represented as 0xffffffc0 (in 32 bit register). Thereafter the number is shifted and the result(-4) is returned as int.
Thanks A.Kumar,

The article was very useful and answers my question.

Thanks once again!
Kunal
I still haven't got any reply.

Would really appreciate any pointers around the same.
Issue
--------------------------

-> Could not understand where exactly String constant pool is maintained (in memory) by JVM. Earlier I was under the impression that its a part of RunTime constant pool (which is per-class or per-interface runtime representation of the constant_pool table in a class file), but since String constant pool is common across the application, my assumption was wrong.

My RnD
-------------------------
-> Although I did some googling but failed to exactly find any answer.


I would really appreciate if somebody could throw some light on this topic.

Thanks,
Kunal
Hi Anand,

The compiler doesnt narrow down a value unless you mention it otherwise which requires *explicit* type casting to truncate bits. If without tinkering with the *value*, the compiler can assign an *int* literal to a *byte* then it would go a head and do it without cribbing but if the left hand literal doesnt fit in the Right hand variable then it would throw a compilation error in doing the same.

Hope this help.
Kunal