- Dec 15, 2003
- 540
- 0
- 0
a string or a char..how big are they in java?
is a char 1 byte? and is each character in a string 1byte as well?
i.e.
public String myString = "hello";
is that myString 5bytes big?
and on another note, if i were to try to send 200KB message from a Server to a Client, could i just make an array big enough to hold about 40,000 myString variables to make the new array equal to 200KB and send that array? the purpose of that is to calculate the bandwidth by sending a package of 200KB from a server to a client.
thanks in advance for any feedback
is a char 1 byte? and is each character in a string 1byte as well?
i.e.
public String myString = "hello";
is that myString 5bytes big?
and on another note, if i were to try to send 200KB message from a Server to a Client, could i just make an array big enough to hold about 40,000 myString variables to make the new array equal to 200KB and send that array? the purpose of that is to calculate the bandwidth by sending a package of 200KB from a server to a client.
thanks in advance for any feedback
