Introduction: A First Look at Java

We will begin this chapter with the prerequisites, learning objectives, and overview.

We'll cover the following



After completing this chapter, you should be able to:

  • Create valid Java identifiers
  • Write Java statements that display text
  • Describe primitive data types int, double, char, and boolean
  • Declare variables and assign values to them
  • Read numbers and characters from the keyboard
  • Write comments in a Java program
  • Write a Java program that uses the above-mentioned aspects of Java


In this chapter, we’ll look at a few simple programs. These programs will include the use of some basic Java components, like statements that read input from the keyboard, some arithmetic, and displaying the results. We will show you how to

  • Declare variables
  • Make assignments
  • Read input
  • Display text
  • Write comments

Get hands-on with 1200+ tech skills courses.