(CPEN 221) A Gentle Introduction to Java

GSathish
25.9K views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

1.1 Programs, Fields

First Example
Second Example

1.2 Java as a Calculator

Operators
Operators
Not Quite Math
Not Quite Math
Negative Results

1.3 Syntax

Syntax
Syntax
Syntax

2.1 Using Fields

Using Fields
Using Fields
Getting Paid
Calculating Revenue

2.2 Beyond ints

String Examples
Conctenating Strings
Conctenating Strings
Video Game Example Initial Attempt
Video Game Example Second Attempt
Number Precision
Rectangle

2.3 Java Checks Types

Mixing Strings and ints
Mixing Strings and ints
Mixing Strings and ints

3.1 Capturing Repeated Work with Methods

Using Methods
Using Methods
Using Methods

3.2 Methods as Descriptions of Tasks

Implementing Tasks
Following the Design Recipe
Following the Design Recipe

3.3 With Great Power Comes More Opportunity for Mistakes

Understanding Errors
Understanding Errors
Understanding Errors
Understanding Errors

4.1 Beyond Arithmetic and Concatenation

Using Conditions
Using Conditions
Using Conditions
Using Conditions

4.2 More Examples of Decision-Making Programs

Using Conditions
Using Conditions
Using Conditions

5.1 Representing Compound Data

Combining Data into Classes

5.2 More on Methods

Creating Instances of Classes

5.3 Variables and Scope

Total Cost Calculation
Variable fill-in
Bad Scope
Bad Scope Experimentation