Primitive Type vs. Reference Type
Java
int a = 11; // Primitive Type
Integer b = new Integer(11); // Reference Type
+================+=========+===================================================================================+
| Primitive type | Size | Description |
+================+=========+===================================================================================+
| byte | 1 byte | Stores whole numbers from -128 to 127 |
+----------------+---------+-----------------------------------------------------------------------------------+
| short | 2 bytes | Stores whole numbers from -32,768 to 32,767 |
+----------------+---------+-----------------------------------------------------------------------------------+
| int | 4 bytes | Stores whole numbers from -2,147,483,648 to 2,147,483,647 |
+----------------+---------+-----------------------------------------------------------------------------------+
| long | 8 bytes | Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
+----------------+---------+-----------------------------------------------------------------------------------+
| float | 4 bytes | Stores fractional numbers. Sufficient for storing 6 to 7 decimal digits |
+----------------+---------+-----------------------------------------------------------------------------------+
| double | 8 bytes | Stores fractional numbers. Sufficient for storing 15 decimal digits |
+----------------+---------+-----------------------------------------------------------------------------------+
| char | 2 bytes | Stores a single character/letter or ASCII values |
+----------------+---------+-----------------------------------------------------------------------------------+
| boolean | 1 bit | Stores true or false values |
+----------------+---------+-----------------------------------------------------------------------------------+
Also in Java:
- Title
- how to read in a file in java
- Category
- Java
- Title
- java get current milliseconds
- Category
- Java
- Title
- D/NetworkSecurityConfig: No Network Security Config specified, using platform default
- Category
- Java
- Title
- spigot run command as console
- Category
- Java
- Title
- Java nested array hashcode
- Category
- Java
- Title
- function in java
- Category
- Java
- Title
- method overloading
- Category
- Java
- Title
- money value commas java
- Category
- Java
- Title
- spigot broadcast message
- Category
- Java
- Title
- cannot lock java compile cache as it has already been locked by this process
- Category
- Java
- Title
- initialize applet in java
- Category
- Java
- Title
- firebase connecten
- Category
- Java
- Title
- java swing button on click
- Category
- Java
- Title
- java create file with content
- Category
- Java
- Title
- java intercept ctrl c
- Category
- Java
- Title
- getindexrequest elasticsearch
- Category
- Java
- Title
- java read from file
- Category
- Java
- Title
- how to compare two maps in java
- Category
- Java
- Title
- the type javax.servlet.ServletException cannot be resolved. It is indirectly referenced from required .class files
- Category
- Java
- Title
- reading string after double in java
- Category
- Java
- Title
- for next loop javasxcrop
- Category
- Java
- Title
- string replace java
- Category
- Java
- Title
- java for loop add multiple declarations
- Category
- Java
- Title
- substring java
- Category
- Java
- Title
- same method name with different arguments
- Category
- Java
- Title
- select photo from camera android
- Category
- Java
- Title
- Manifest merger failed androidx
- Category
- Java
- Title
- java sleep in code
- Category
- Java
- Title
- java for in loop
- Category
- Java
- Title
- check if map contains key java
- Category
- Java
- Title
- how to find length of array in java
- Category
- Java
- Title
- java substring
- Category
- Java
- Title
- Write a JAVA method that expands a given binomial (ax + by)n, where integers a, b, n are user inputs. For example, if a = 2, b = -12, n = 4 are entered the method should print or return
- Category
- Java
- Title
- java program to display characters from a to z using loop
- Category
- Java
- Title
- java type casting
- Category
- Java
- Title
- add in list java
- Category
- Java
- Title
- convert string into unicode java
- Category
- Java
- Title
- how to change the color of a menubar in java
- Category
- Java
- Title
- list java oracle
- Category
- Java
- Title
- java create map
- Category
- Java
- Title
- math min max java
- Category
- Java
- Title
- get file path java
- Category
- Java
- Title
- java time code
- Category
- Java
- Title
- remove extra blank spaces from string in java
- Category
- Java
- Title
- google map set default zoom android studio
- Category
- Java
- Title
- mkyong restful web services spring boot examples post
- Category
- Java
- Title
- biginteger in java
- Category
- Java
- Title
- j
- Category
- Java
- Title
- tolowercase java
- Category
- Java
- Title
- java store hexadecimal value
- Category
- Java
- Title
- boolean java.lang.String.equals(java.lang.Object)' on a null object reference
- Category
- Java
- Title
- get drawable with string android java
- Category
- Java
- Title
- generate objects with for loop java
- Category
- Java
- Title
- set java
- Category
- Java
- Title
- java convert a string to char[]
- Category
- Java
- Title
- java letter alphabet index
- Category
- Java
- Title
- what is java plug-in
- Category
- Java
- Title
- converter int array para string java
- Category
- Java
- Title
- Java sort Map by values
- Category
- Java
- Title
- for loop in java stack overflow
- Category
- Java
- Title
- index of an array procesing
- Category
- Java
- Title
- public static void main(string args)
- Category
- Java
- Title
- java hashmap syntax
- Category
- Java
- Title
- how to quicksort a string array in java
- Category
- Java
- Title
- enum in java
- Category
- Java
- Title
- bukkit java get player count
- Category
- Java
- Title
- java random number
- Category
- Java
- Title
- if statement java
- Category
- Java
- Title
- random code
- Category
- Java
- Title
- java how to compare strings
- Category
- Java
- Title
- java create circle
- Category
- Java
- Title
- inputstream to string java
- Category
- Java
- Title
- spigot spawn firework
- Category
- Java
- Title
- nth prime number java
- Category
- Java
- Title
- get spring application context
- Category
- Java
- Title
- hashset contains java
- Category
- Java
- Title
- what is java
- Category
- Java
- Title
- how timer class and display to jtextfield w3schools in java
- Category
- Java
- Title
- formartted string java
- Category
- Java
- Title
- how to do a linear searc in java
- Category
- Java
- Title
- hide elements android
- Category
- Java
- Title
- instantiate optinal java 8
- Category
- Java
- Title
- iterate through hashmap java
- Category
- Java
- Title
- méthode retourne nom classe java
- Category
- Java
- Title
- java clear console
- Category
- Java
- Title
- random boolean java
- Category
- Java
- Title
- string to double java
- Category
- Java
- Title
- google translate
- Category
- Java
- Title
- java array check duplicates
- Category
- Java
- Title
- how to import a scanner in java
- Category
- Java
- Title
- what is enum in java
- Category
- Java
- Title
- android create snackbar
- Category
- Java
- Title
- java constructor genertic
- Category
- Java
- Title
- java remove non numbers from string
- Category
- Java
- Title
- array in java stack overflow
- Category
- Java
- Title
- get raondom from array java
- Category
- Java
- Title
- spring data jpa inheritance repository
- Category
- Java
- Title
- capcitor FERR_CLEARTEXT_NOT_PERMITTED
- Category
- Java
- Title
- java load image
- Category
- Java
- Title
- converting char array to string
- Category
- Java