Object Oriented Programming
Object Oriented Programming
ORIENTED
INTEGRATED DEVELOPMENT ENVIRONMENT
PROGRAMMING (IDE)
- introduction to encapsulation
PROGRAMMING FUNDAMENTALS
TYPES OF TEST PART 1
- multiple choice 20pts
PROGRAMMING ERRORS
- code analysis 7 items 14pts (Java
fundamentals) 3 TYPES OF ERROR
- class diagram analysis (class diagram is
1. Syntax error
given, just answer 6 questions)
- Error detected by compiler
- class UML diagram design (Translate
description to diagram 10pts) 2. Runtime Error
- Program terminates
abnormally.
3. Logic Error
INTRODUCTION TO JAVA - Program does not perform the
way it was intended to
BACKGROUND
IDENTIFIERS
- Developed by James Gosling’s team
at Sun Microsystems. - Names that identifies classes,
- Sun Microsystems was purchased by methods,and variables
Oracle in 2010. - An identifier must start with a letter,
- Originally called oak. an underscore (_), or a dollar sign
- Originally used in embedded chips in ($). It cannot start with a digit.
electronic appliances. - An identifier cannot be a reserved
- “Write once run anywhere” word.
- An identifier cannot be true, false, or
TECHNOLOGY
null.
- Java initially became attractive - An identifier can be of any length.
because Java programs can run
PRIMITIVE DATA TYPES
from a web browser. Such programs
are called applets. - integers, real numbers, characters,
and Boolean types.
FEATURES
- known as primitive data types or
- Java runs on a hypothetical fundamental types.
computer known as the Java Virtual
VARIABLES
Machine (JVM).
- “Write once, run anywhere” (WORA) - Variables are used to represent
is the slogan developed by Sun values that may be changed in the
Microsystems program.
- Variables are for representing data of - is a construct that enables a
a certain type. program to specify alternative paths
of execution.
PROGRAMMING FUNDAMENTALS
IF-ELSE STATEMENT
PART 2 - Two-way statement
NESTED IF STATEMENT
Named Constant - The statement in an if or if-else
- syntax: final datatype CONSTANT statement can be any legal Java
NAME = value; statement, including another if or
if-else statement.
TERNARY OPERATOR
AUGMENTED ASSIGNMENT OPERATORS
- Short-hand if else
- Ex. count = count + 1;
- count += 1; SWITCH STATEMENT
- F+T=T terminates.