Abstract
Outcomes:
By the end of this chapter you should be able to:
-
distinguish between the eight built-in primitive types of Java;
-
declare and assign values to variables;
-
create constant values with the keyword final;
-
use the input methods of the Scanner class to get data from the keyboard;
-
design the functionality of a method using pseudocode.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
To force the use of one division routine over another, a technique known as type casting can be used. We will return to this technique in later chapters.
- 2.
We have used bold italic font to represent user input.
- 3.
Of course you will not be able to use the Greek letter π as a name for a variable or constant. You will need to give it a name like PI.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Charatan, Q., Kans, A. (2019). Building Blocks. In: Java in Two Semesters. Texts in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-319-99420-8_2
Download citation
DOI: https://doi.org/10.1007/978-3-319-99420-8_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-99419-2
Online ISBN: 978-3-319-99420-8
eBook Packages: Computer ScienceComputer Science (R0)