\cat programming
javac foo.java java foo
If foo.java declares a package name at the top of the file:
package bar;
then all the related files should be in a "bar" directory and run it like the following under the parent directory of the "bar":
java [-classpath .] bar.foo
There is no sizeof implementation for Java because all primitives have the same sizes over all JVM.
Type | Size |
boolean | 1 bit |
char | 16 bit |
byte | 8 bit |
short | 16 bit |
int | 32 bit |
long | 64 bit |
float | 32 bit |
double | 64 bit |