Multiple choice general knowledge science & technology

Which of the following datatypes occupy the same memory size??

  1. long and float

  2. int and float

  3. long and double

  4. byte and short

Reveal answer Fill a bubble to check yourself
B,C Correct answer
Explanation

In Java, int and float both occupy 4 bytes (32 bits) of memory. Similarly, long and double both occupy 8 bytes (64 bits). Option A is wrong because long is 8 bytes while float is 4 bytes. Option D is wrong because byte is 1 byte while short is 2 bytes.