Explore tens of thousands of sets crafted by our community.
Java Data Types
15
Flashcards
0/15
Set<Integer>
The Set<Integer> data type represents a set of Integer objects without duplicates. It's part of the Collections framework. Example declaration: Set<Integer> uniqueNums = new HashSet<>();
int
An int data type is a 32-bit signed integer. Example declaration: int num = 100000;
float
A float data type is a single-precision 32-bit IEEE 754 floating point. Example declaration: float num = 10.0f;
List<String>
The List<String> data type represents a list of String objects. It's part of the Collections framework. Example declaration: List<String> names = new ArrayList<>();
short
A short data type is a 16-bit signed integer. Example declaration: short num = 1000;
Map<String, Integer>
The Map<String, Integer> data type represents a mapping of keys to values. No duplicate keys allowed. It's part of the Collections framework. Example declaration: Map<String, Integer> ageMap = new HashMap<>();
Object
The Object data type is the root of the class hierarchy in Java. Every class has Object as a superclass. Example declaration: Object obj = new Object();
String
The String data type represents a sequence of characters and is not a primitive data type. It's a class. Example declaration: String name = "Alice";
long
A long data type is a 64-bit signed integer. Example declaration: long num = 100000L;
double
A double data type is a double-precision 64-bit IEEE 754 floating point. Example declaration: double num = 10.0;
boolean
A boolean data type represents one bit of information but its size isn't something that's precisely defined. Example declaration: boolean flag = true;
byte
A byte data type is an 8-bit signed integer. Example declaration: byte num = 100;
int[]
The int[] data type represents an array of integers. Example declaration: int[] numbers = {1, 2, 3};
double[][]
The double[][] data type represents a two-dimensional array of double values. Example declaration: double[][] matrix = { {1.1, 1.2}, {2.1, 2.2} };
char
A char data type is a single 16-bit Unicode character. Example declaration: char letter = 'A';
© Hypatia.Tech. 2024 All rights reserved.