Hi I am a newbie to the forums. I am derusting my java skills, just say it's been a while when I last hacked at it-and even then I'm a rank novice.
I came across a fairly good o'rielly book (Head first Java).I'm hacking with 1.4.2 I think it is-it's what ever the latest greatest 1.4 java SDK is around.
I ran into some interesting questions- Is their a clean way to work with primitives, such as numbers in 1.4, I can always 'upgrage' to 1.5 that suposedly adresses these problems.
I ran into this when i was horsing around with a early example- that wants you to declare a int size variable, give it three different vallues.
When I made them fairly big I got: -2389127389172910102389908 is to big for int! Making it a BigInteger results in incomatible type errors. (I do realize that a large amount of this is well beyoned anything I'm likely to run into for quite sometime.)
> I came across a fairly good o'rielly book (Head first > Java).I'm hacking with 1.4.2 I think it is-it's what ever > the latest greatest 1.4 java SDK is around.
Actually 1.5 is the latest and there is a beta-version of 1.6 which concentrates on JavaDesk Top capabilities.
> I ran into some interesting questions- > Is their a clean way to work with primitives, such as > numbers in 1.4, I can always 'upgrage' to 1.5 that > suposedly adresses these problems.
You probably should update to Java 5 better sooner than later. Coz when you try to port old Java 4 code to Java 5 a few things might coz complications down the road on larger problems. Introductions of new Keywords such as enum will cause you problems if you have used this as a variable.
Also you are right. There is auto-boxing in Java 5 e.g. switching between type Integer and primitive int is much easier and in most cases does not have to be explicit.
> I ran into this when i was horsing around with a early > example- that wants you to declare a int size variable, > give it three different vallues. > > When I made them fairly big I got: > -2389127389172910102389908 is to big for int! > Making it a BigInteger results in incomatible type errors.
Sorry its winter in Joburg and my brains numb so I can't respond to this at the moment. Though its the same thing as the passage above (Autoboxing). You can Google it, if you've used Java before the section on Autoboxing on the Sun website will get you started on this less than an hour.
> (I do realize that a large amount of this is well beyoned > anything I'm likely to run into for quite sometime.)