Ch 2: Built-In Data Types for Programming

About This Chapter

Review built-in data types for programming at your convenience using this engaging chapter as your guide. Provided in easy-to-understand lessons, these topics are clearly outlined for you so you can study for an important exam or get help with your homework.

Built-In Data Types for Programming- Chapter Summary

We've put together a resource you can use to study built-in data types for programming any time on your mobile device or computer. Studying is simple with our concise lessons on data types in Java, Java naming conventions and floating point numbers. These lessons are self-paced so you can work as quickly or slowly as needed. Any questions you might have can be directed to an expert via the Dashboard. Once you finish this chapter, you should be ready to:

  • Differentiate between short, long and int data types
  • Define char, string, and Boolean data types in Java
  • Explain Java data type conversion
  • Detail the difference between arithmetic operators and relational operators
  • Discuss APIs in Java
  • Use Java to generate a random number between 1 and 100

13 Lessons in Chapter 2: Built-In Data Types for Programming
Test your knowledge with a 30-question chapter practice test
Overview of Data Types in Java

1. Overview of Data Types in Java

In the following lesson, we will learn about data types in Java. Data types are containers for the data or information we have to store. We will learn about both primitive and non-primitive data types.

Java Naming Conventions: Variables & Constants

2. Java Naming Conventions: Variables & Constants

Sue has friends named Jane and Jayne. Are they the same friends? Probably not. Why? Because their names are spelt differently! Similarly the Java programming language has naming conventions for variables and constants. In this lesson we will learn about these conventions.

Java Data Types: Short, Int & Long

3. Java Data Types: Short, Int & Long

This lesson will provide a overview of the Java primitive Java data types: short, int, and long. These whole-number data types have a range of uses. We will provide syntax and examples of their use in programming.

Java: Floating Point Numbers

4. Java: Floating Point Numbers

In Java, floating point numbers are numbers that have a decimal part to them. Java has two basic floating point data types - float and double. In this lesson, we'll learn what they are and how to use them.

Java: Char Data Type

5. Java: Char Data Type

Whether you pronounce it 'char' or 'care', the Java char data type has no relation to burned beef or care. It is simply short for character (as on a keyboard). This lesson will provide an overview of the char data type, and some examples of its use.

Java: String Data Type

6. Java: String Data Type

In Java, strings are not chased by cats. A string is a sequence, or string, or single characters. This lesson will define the string data type, and provide some examples of its use.

Java: Boolean Data Type

7. Java: Boolean Data Type

True or false? This is a question that's asked frequently in programming languages. Java is no exception. In this lesson, we'll learn about the Boolean data type (true or false) and provide some examples.

Java Data Type Conversion

8. Java Data Type Conversion

You'll learn how to move values contained in one Java data type into a different data type, as well as the consequences of any conversion that may take place.

Java: Arithmetic Operators

9. Java: Arithmetic Operators

A large chunk of programming involves math, from addition to multiplication to modulo operations. These math operations need not be confusing or overly complex. This lesson will cover the arithmetic operators in Java and provide working code examples.

Java: Relational Operators

10. Java: Relational Operators

Programming is all about testing and comparing values. Are they equal, or less than, or more than? The Java relational operators help us in these operations. This lesson will explain the operators and provide syntax examples.

APIs in Java

11. APIs in Java

Java provides a wide array of tools in your programs to perform many tasks, such as reading files or taking input from the keyboard. These tools are collectively called the Java APIs. This lesson will provide an overview and code examples of APIs in action.

Java: Generate Random Number Between 1 & 100

12. Java: Generate Random Number Between 1 & 100

Random numbers are important in programming, especially in gaming. This lesson will describe how to generate a random number between 1 and 100. We will also discuss the concept of randomness.

Java Coding Project Ideas

13. Java Coding Project Ideas

Engage your high school students in these intermediate to advanced level Java coding projects. Each independent project allows students to explore a real-world application of this coding language.

Chapter Practice Exam
Test your knowledge of this chapter with a 30 question practice chapter exam.
Not Taken
Practice Final Exam
Test your knowledge of the entire course with a 50 question practice final exam.
Not Taken

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.