3
34stunts
Consider the following code:
byte b[] = new byte[34];
for (int x = 0; x < b.length; x++)
{
System.out.println((int) b[x] );
}
Java compiles it and runs it. This prints a bunch of "0".
So my question is this correct code? Or should/must I have a loop to
assign it to 0. Is it a rule that a newly created byte is 0 or is this
merly a coincidence?
-
Fred
byte b[] = new byte[34];
for (int x = 0; x < b.length; x++)
{
System.out.println((int) b[x] );
}
Java compiles it and runs it. This prints a bunch of "0".
So my question is this correct code? Or should/must I have a loop to
assign it to 0. Is it a rule that a newly created byte is 0 or is this
merly a coincidence?
-
Fred