Chapter 1 Object-Oriented Programming Using Java

Chapter 1 Object-Oriented Programming

Using Java

Data Structures and Algorithms in Java

Objectives

Discuss the following topics: ? Rudimentary Java ? Object-Oriented Programming (OOP) in Java ? Input and Output ? Java and Pointers ? Vectors in java.util

? Data Structures and Object-Oriented Programming

? Case Study: Random Access File

Data Structures and Algorithms in Java

2

Rudimentary Java

? A Java program is a sequence of statements that have to be formed in accordance with the predefined syntax

? A statement is the smallest executable unit in Java

? Each statement ends with a semicolon ? Compound statements, or blocks, are marked

by delimiting them with braces, { and }

Data Structures and Algorithms in Java

3

Variable Declarations

? Each variable must be declared before it can be used in a program

? It is declared by specifying its type and its name ? Variable names are strings of any length of

letters, digits, underscores, and dollar signs that begin with a letter, underscore, or dollar sign ? A letter is any Unicode letter ? Java is case sensitive

Data Structures and Algorithms in Java

4

Variable Declarations (continued)

? A type of variable is either:

? One of the eight built-in basic types ? A built-in or user-defined class type ? An array

Data Structures and Algorithms in Java

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download