Docsity

Java Programming Chapter 1, Slides of Java Programming

Toggle sidebar
bg1
About the Presentations
•The presentations cover the objectives found in the
opening of each chapter.
•All chapter objectives are listed in the beginning of
each presentation.
•You may customize the presentations to fit your
class needs.
•Some figures from the chapters are included. A
complete set of images from the book can be found
on the Instructor Resources disc.
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31

Partial preview of the text

Download Java Programming Chapter 1 and more Slides Java Programming in PDF only on Docsity!

About the Presentations

  • (^) The presentations cover the objectives found in the

opening of each chapter.

  • (^) All chapter objectives are listed in the beginning of

each presentation.

  • (^) You may customize the presentations to fit your

class needs.

  • (^) Some figures from the chapters are included. A

complete set of images from the book can be found

on the Instructor Resources disc.

1

Java Programming

Sixth Edition

Chapter 1

Creating Your First Java Classes

Objectives (cont'd.)

  • (^) Add comments to a Java class
  • (^) Save, compile, run, and modify a Java application
  • (^) Create a Java application that produces GUI output
  • (^) Correct errors and find help

Learning About Programming

  • (^) Program
    • (^) Set of written instructions that tells computer what to do
  • (^) Machine language
    • (^) Most basic circuitry-level language
    • (^) Low-level programming language

Learning About Programming (cont'd.)

  • (^) Compiler or interpreter
    • (^) Translates language statements into machine code
  • (^) Syntax error
    • (^) Misuse of language
    • (^) Misspelled programming language word
  • (^) Debugging
    • (^) Freeing program of all errors
  • (^) Logic errors
    • (^) Also called semantic errors
    • (^) Incorrect order or procedure

Comparing Procedural and Object-

Oriented Programming Concepts

  • (^) Procedural programming
    • (^) Sets of operations executed in sequence
    • (^) Variables
      • (^) Named computer memory locations that hold values
    • (^) Procedures
      • (^) Individual operations grouped into logical units
  • (^) Object-oriented programs
    • (^) Create classes
    • (^) Create objects from classes
    • (^) Create applications

Understanding Classes, Objects and

Encapsulation

  • (^) Class
    • (^) Describes objects with common properties
    • (^) Definition
    • (^) Instance
  • (^) Attributes
    • (^) Characteristics that define object
    • (^) Differentiate objects of same class
    • (^) Value of attributes is object’s state
  • (^) Objects
    • (^) Specific, concrete instance of a class

Understanding Objects and Classes

(cont'd.)

Understanding Inheritance and

Polymorphism

  • (^) Inheritance
    • (^) Important feature of object-oriented programs
    • (^) Classes share attributes and methods of existing classes but with more specific features
    • (^) Helps you understand real-world objects
  • (^) Polymorphism
    • (^) Means “many forms”
    • (^) Allows same word to be interpreted correctly in different situations based on context

Features of the Java Programming

Language

  • (^) Java
    • (^) Developed by Sun Microsystems
    • (^) Object-oriented language
    • (^) General-purpose
    • (^) Advantages
      • (^) Security features
      • (^) Architecturally neutral

Features of the Java Programming

Language (cont'd.)

  • (^) Bytecode
    • (^) Statements saved in file
    • (^) Java compiler converts source code into binary program
  • (^) Java interpreter
    • (^) Checks bytecode and communicates with operating system
    • (^) Executes bytecode instructions line by line within Java virtual machine

Features of the Java Programming

Language (cont'd.)

Analyzing a Java Application That

Produces Console Output

  • (^) Even simplest Java application
    • (^) Involves fair amount of confusing syntax
  • (^) Print “First Java application” on screen

Analyzing a Java Application That

Produces Console Output (cont'd.)