Distinguish between a primitive type and a reference type in Java, with two examples of each.
Values and Data Types
Original Khojo Papers practice question — not from a past board paper.
byte 1 byte, short 2 bytes, int 4 bytes, long 8 bytes, float 4 bytes, double 8 bytes, char 2 bytes and boolean, whose size is not precisely defined by the language.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
Everything else in Java is a reference type.
From the same topic and chapter, at a similar level.
Distinguish between a primitive type and a reference type in Java, with two examples of each.
Values and Data Types
What is the output of: int a = 7; int b = 2; System.out.println(a / b); System.out.println((double) a / b);
Values and Data Types
Distinguish between implicit and explicit type conversion in Java, with an example of each.
Values and Data Types
What is the output of: System.out.println(10 / 3); System.out.println(10 % 3); System.out.println(10.0 / 3);
Values and Data Types
What is a constructor? State three of its characteristics.
Constructors
Distinguish between a class and an object.
Introduction to Object-Oriented Programming