www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons Java Data Types Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Java has two "categories" of types: primitive types and reference types.

Primitive Types
Primitive data types are generally used for local variables, parameters and instance variables (properties of an object). Primitive data types are located on the stack and we can only access their value, while objects are located on heap and we have a reference to those objects. Also, when invoking methods in java, primitive data types are always passed by value and objects are always passed by reference. All the primitive types have specified sizes that are machine independent for portability.

boolean same as bool in C++
1 byte in size
char holds one 16 bit unicode character
2 bytes in size
byte 8-bit signed integer
1 byte in size
short 16-bit signed integer
2 bytes in size
int 32-bit signed integer
4 bytes in size
long 64-bit signed integer
8 bytes in size
float floating-point number
4 bytes in size
double double precision floating-point number
8 bytes in size

Reference Types
Arrays and objects of classes are the examples of Java reference types. Arrays and classes are discussed in the coming lessons. There are no struct, union, enum, unsigned, typedef, or pointer types in Java.
Next >>> Lesson No. 4: Java Arrays vs C++ Arrays

Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.