[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

size of a short



Hello GCC guys,

I'm currently starting with java and wrote a little test program to
determine to max size of a data type (in this case short).

In the java documentation it states that all data types are of fixed
size, not depending on the compiler or vm used, still when i compile the
program with gcj and run it, it tells me a short has the size of an
int.. 

When i compile the program using "sablevm", the size of a short is
correctly determined..

The test program is attached to this mail.


best regards,

Deniz Adrian
public class Test
{
	public static void main (String[] argv)
	{
		short a= 0;

		while (++a > 0) {}

		System.out.println("max short size: "+ --a);
	}
}

Attachment: signature.asc
Description: Digital signature


Reply to: