Stuart Freeman

Greenhorn
+ Follow
since Jun 16, 2005
Merit badge: grant badges
For More
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 Stuart Freeman

what exactly would you like to talk about?
A "worldwide discount" is exactly what it says it is.
I bought a SCWCD exam certificate from Sun UK before the 30th June discount deadline but did not receive a discount on my credit card payment as others on the forum have experienced.

On querying the matter via email I was informed that "this promotion is not valid in the UK" and therefore I was not entitled to a 25% refund.

As the sun.com website promotion stated clearly "Offer valid worldwide". I wrote back to Sun UK and asked again (politely) for a refund. I also asked if I should get The Trading Standards Authority involved as the promotion was extremely misleading if individual countries could opt out.

Sun UK agreed to honour the discount "as a gesture of goodwill" and gave me an apology which warmed the cockles of my heart.

Anyone from the UK who bought a voucher expecting to receive the discount and did not receive it... don't let sun UK fob you off. Write a firm but polite email and demand a refund.
Variables whether they refer to primitives or objects are always passed by value. With primitives, the value passed is a copy of the bit pattern the variable has been assigned. With objects, the value is a copy of the memory location of the object being referenced. Strings being objects are no different in this respect but they are immutable. The decision to make them so appears to have been based on performance and memory efficiency as discussed below:

From: Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027) by Kathy Sierra (Editor), Bert Bates (Editor)

One of the key goals of any good programming language is to make efficient use of memory. As applications grow, it�s very common that String literals occupy large amounts of a program�s memory, and that there is often a lot of redundancy within the universe of String literals for a program. To make Java more memory efficient, the JVM sets aside a special area of memory called the �String constant pool.� When the compiler encounters a String literal, it checks the pool to see if an identical String already exists. If a match is found, the reference to the new literal is directed to the existing String, and no new String literal object is created. (The existing String simply has an additional reference.) Now we can start to see why making String objects immutable is such a good idea. If several reference variables refer to the same String without even knowing it, it would be very bad if any of them could change the String�s value.
18 years ago
Strings are immutable... they do not behave like other objects. If you want a mutable string (which will give you the behaviour you expected), have a look at the StringBuffer class.
18 years ago
Try this:

String Samt = "3454";
Long Lamt = Long.parseLong(Samt); // String to a Long
long lAmt = Lamt.longValue(); // Long to long
18 years ago