English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Please mail the answer soon or messeage at jas_rohilla.

2006-07-18 01:48:41 · 5 answers · asked by jas_rohilla 1 in Computers & Internet Programming & Design

5 answers

Is this java? I believe the only difference is that the literal "Hi" in the second one can be used by mulitple variables, each referring to the same place in memory, whereas multiple instances of the first one will each have their own place in memory.

Functionally, it doesn't make much difference since String's are immutable anyways.

If this isn't java, forget all that I just said.

2006-07-18 01:52:36 · answer #1 · answered by scruffy 5 · 0 0

Which framework are you talking about here?
Java or .net?

in .net this will give you an error because there's no constructor for the String class that takes a string as a param.

In java, it's the same. However your syntax will not work in Java either since there's no string class (with a small "s" letter). Should be String s1 = new String("Hi");

2006-07-18 01:58:28 · answer #2 · answered by alaa_tm 3 · 0 0

In Java they are the same thing. I prefer the second way of doing it.

2006-07-18 21:12:41 · answer #3 · answered by Craig E 2 · 0 0

both are same

2006-07-18 01:55:16 · answer #4 · answered by $$-SilentSakky-$$ 4 · 0 0

what's the language here ?

2006-07-18 02:08:12 · answer #5 · answered by mdy 2 · 0 0

fedest.com, questions and answers