Which of the following code to declare and initialize variables to store whole numbers are correct?
c, d, f, g
A and B are incorrect. There are no primitive data types in Java named bit and integer. The correct names are byte and int.
C is correct. It assigns a hexadecimal literal value to the variable a3.
D is correct. It assigns an octal literal value to the variable a4.
E is incorrect. It defines a variable of type double, which is used to store decimal numbers, not integers.
F is correct. -0 is a valid literal value.
G is correct. 123456789 is a valid integer literal value that can be assigned to a variable of type long.