- Common Java
- Java Basic Notes
- Basic Programs
- Algorithms & Data Structure
- Algorithm Programs
- Design Patterns
- Build Tools
- Multi-Threading & Concurrency
This project contains many java most asked interview question with example
A primitive type always have a value.
Data Type | Default | Size | Range | Algorithm |
---|---|---|---|---|
boolean | false | 1 bit | true or false | simple flags |
char | '\u0000' | 2 byte | '\u0000' (or 0) to '\uffff' (or 65,535 inclusive) | single 16-bit Unicode character |
byte | 0 | 1 byte | -128 to 127 (inclusive) | 8-bit signed two's complement integer |
short | 0 | 2 byte | -32,768 to 32,767 (inclusive) | 16-bit signed two's complement integer |
int | 0 | 4 byte | -2,147,483,648 (-2^31) to 2,147,483,647 (2^31 -1) (inclusive) | 32-bit signed two's complement integer |
long | 0L | 8 byte | -9,223,372,036,854,775,808(-2^63) to 9,223,372,036,854,775,807(2^63 -1)(inclusive) | 64-bit two's complement integer |
float | 0.0f | 4 byte | unlimited | single-precision 32-bit IEEE 754 floating point |
double | 0.0d | 8 byte | unlimited | double-precision 64-bit IEEE 754 floating point |
A non-primitive type can be null
.
- Strings
- Arrays
- Classes
- Interface
- Enum
© 2018 sorabh86