brentwoodhigh.com

| repl.it | w3schools.com | 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
abstraction

2.2 string literals

string concatenation
escape sequences

2.3 variables and assignments

variables
the assignment statement
constants

2.3 PPT
PPT Questions

2.4 primitive data types

integers and floating points
characters
booleans

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 Countdown.java
Listing 2.2 Facts.java
Listing 2.3 Addition.java
Listing 2.4 Roses.java
Listing 2.5 PianoKeys.java
Listing 2.6 Geometry.java
Listing 2.7 TempConverter.java
Listing 2.8 IceCream.java
Listing 2.9 StringMutation.java
Listing 2.10 RandomNumbers.java
Listing 2.11 Echo.java
Listing 2.12 Quadratic.java
Listing 2.13 Price.java
Listing 2.14 CircleStats.java

 

 

 

 

 

 

 

 

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

About Us | Contact Us | ©2005 brentwoodhigh.com