8 is a number, not an integer. In java, by default, integers are stored with int type, and the length of int type is 4 bytes.
And if it is "8" in double quotation marks, it is a string constant (also called literal quantity or direct string quantity). In java, a String is an object like String, and a string is an immutable object.