code is emotional
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors

fred rosenberger wrote:It actually says more than just what you listed...it tells you the exact line where the problem is:
My question to you would be what exact value to you expect to be assigned to j on line 9?
code is emotional
code is emotional
Giovanni Montano wrote:so the compiler says : ehy dude I cannot assign null to zero because null is not a value.
Pawel Pawlowicz wrote:
Giovanni Montano wrote:so the compiler says : ehy dude I cannot assign null to zero because null is not a value.
Nitpick time!
1. It's JVM that tells you that. Not the compiler. Compiler doesn't mind as the syntax is correct.
2. In your example you were trying to assign null to int variable, not null to zero.
code is emotional
Giovanni Montano wrote:thank youd dear ranch friend, you gained 1 point for your nitpicky finicky approach, you are seriously contributing to my ascent as future Java guru. really appreciated.
Pawel Pawlowicz wrote:
Giovanni Montano wrote:thank youd dear ranch friend, you gained 1 point for your nitpicky finicky approach, you are seriously contributing to my ascent as future Java guru. really appreciated.
Is it some kind of sarcasm or not? I can't tell![]()
What I can tell is that in programming (even at beginner level) being precise is VERY important.
code is emotional
Giovanni Montano wrote:so... integer i is an instance variable
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:There is no such thing as an "integer" in java. You have "int" types (primitives), or you have "Integers", which are objects.
code is emotional
Pawel Pawlowicz wrote:Omigod! Nitpick war!
![]()
fred rosenberger wrote:There is no such thing as an "integer" in java. You have "int" types (primitives), or you have "Integers", which are objects.
No, you don't have int types! You have int type! There is only one int type. Not many ;).
Not talking about integer types ;)
Your turn ;).
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
code is emotional
fred rosenberger wrote:[abusing moderator power to edit my previous post is one of the perks!!!]
Giovanni Montano wrote:integer i; is not an object but a reference variable to an object
Joanne
Pawel Pawlowicz wrote:Do you have to have moderator rights to edit your own post? I don't think so!
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
code is emotional
Giovanni Montano wrote:Thank you but in a certain way can I say integer i is reference variable...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Giovanni Montano wrote:Thank you but in a certain way can I say integer i is reference variable...
Not only can you say it is. It IS.
(mega CUT )
Winston
i think i love you already!code is emotional
… and you would still have suffered a NullPointerException.Winston Gutkowski wrote: . . .
Before version 5, you would have had to write:
j = i.intValue();
and the compiler would have enforced it.
. . .
Campbell Ritchie wrote:The Java Language Specification talks about integral types.

Campbell Ritchie wrote:… and you would still have suffered a NullPointerException.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Yes, I know, but how can you tell people to shut up about the nitpicking?Pawel Pawlowicz wrote: . . .
This is what you get when you declare a nitpick war
Particularly if the nitpick war is more fun than the rest of the threadA few minutes ago, I wrote: . . . how can you tell people to shut up about the nitpicking?

| Consider Paul's rocket mass heater. |