Java - Basic Data Types

Java - Basic Data Types

Author: Nate Rock

The Goal of this Packet to introduce a learner to basic data types in Java.

What is the difference between and Object and a primitive in the Java programming language? This packet will introduce the concept and show you the 8 basic data types.

See More
Try a College Course Free

Sophia’s self-paced online courses are a great way to save time and money as you earn credits eligible for transfer to over 2,000 colleges and universities.*

Begin Free Trial
No credit card required

28 Sophia partners guarantee credit transfer.

264 Institutions have accepted or given pre-approval for credit transfer.

* The American Council on Education's College Credit Recommendation Service (ACE Credit®) has evaluated and recommended college credit for 25 of Sophia’s online courses. More than 2,000 colleges and universities consider ACE CREDIT recommendations in determining the applicability to their course and degree programs.


Objects vs primitives

To understand the basic java data types, one needs to make the distinction between Objects and primitives. Java has 8 basic primitives. These are all reserved keywords and don't share state with other primitive values. Objects can contain references to other variables and have functions defined for them.

Primitives and Literals

Video describing java primitives and literals.