|| | Site Stats
Game | Food Drink | Leave Room | Classroom Tardy | Backpack | Music Cell |
Coding I Schedule | Coding I LogIn | Coding I Archive | Coding I Resources |
Coding II Schedule | Coding II LogIn | Coding II Archive | Coding II Resources |
APP schedule | APP LogIn | APP Archive | APP Resources |
CSF schedule | CSF LogIn | CSF Archive | CSF Resources |

Index Chapter 2

This chapter explores the key elements that we use in a program: objects and primitive data. We develop the ability to create and use objects for the services they provide. This ability is fundamental to the process of writing any program in an object-oriented language such as Java. We use objects to manipulate character strings, obtain information from the user, perform complex calculations, and format output. In the Graphics Track of this chapter, we explore the relationship between Java and the Web, and delve into Java’s abilities to manipulate color and draw shapes.


chapter objectives

Establish the difference between primitive data and objects.
Declare and use variables.
Perform mathematical computations.
Create objects and use them for the services they provide.
Explore the difference between a Java application and a Java applet.
Create graphical programs that draw shapes.



2.0 an introduction to objects

an introduction to objects

2.1 using objects

the print and println methods

2.2 string literals

string concatenation
escape sequences

2.3 variables and assignments

the assignment statement

2.3 PPT
PPT Questions

2.4 primitive data types

integers and floating points

2.5 arithmetic expressions

operator precedence
data conversion

2.6 creating objects

the String class

2.7 class libraries and packages

the import declaration
the Random class

2.8 invoking class methods

the Math class
the Keyboard class

2.9 formatting output

the NumberFormat class
the DecimalFormat class

2.10 an introduction to applets


2.11 drawing shapes

the Graphics class
the Color class


Source Code

Listing 2.1
Listing 2.2
Listing 2.3
Listing 2.4
Listing 2.5
Listing 2.6
Listing 2.7
Listing 2.8
Listing 2.9
Listing 2.10
Listing 2.11
Listing 2.12
Listing 2.13
Listing 2.14









Updated: Thursday, July 23, 2020 2:19 PM

About Us | Contact Us | ©2005