Professional Documents
Culture Documents
3. Basic
1. Basic 2. Why 4.Control 5.
notions
concepts Java? Structures Exercise
of Java
Pseudo Code
Algorithm
representation
Flow
diagram/chart
• Human readable
Set grade counter to one • Can easily be converted to any
While grade counter is less than or equal to ten
programming language
Input the next grade
Add the grade into the total
Tape
Document
Input or
output Begin or End
Process, task,
action, or operation
We are used to represent
processes flows
Subroutine
or function
Page
Connecto
connector
r
Decision
Data
Storag
e
Java Basics
2.1 Java Advantages
Java advantages
Java Is Free!
Java Is Object-
Practice Makes
Oriented from
Perfect
the Ground Up
Java Basics
Java Is Free!
Java Basics
Java Is Architecture Neutral
Platform Platform
independent independent
Java source C++ source
code code
Java Basics
Java Is Architecture Neutral
JVM A
JVM B
Java Basics
Java Is Object-Oriented from the Ground Up
Primitive or simple data types are still just single pieces of information
Java Basics
Java Is Object-Oriented from the Ground Up
Java Basics
Practice Makes Perfect
Java Basics
Java advantages
Java Is Free!
Java Is Object-
Practice Makes
Oriented from
Perfect
the Ground Up
Java Basics
2.2 Java Acronyms
Java Basics
Java acronyms
Java Basics
Java acronyms
Java EE
Enterprise
Edition
Java SE
Standard
Edition
Java ME
Micro Edition
Java Basics
3. Basic Notions of Java
Java Basics
3.1 File Structure
A source code file holds one class definition
Same name
Method 1
Method 2
Method 3
Java Basics
A method holds statements
Method 1
Statements
Method 2
Statements
Source file
Method
Class
Method
Java Basics
3.2 Classes
Java Basics
Class definition
This is a
class Class
Define who name
can access
the class:
public
means
everyone can
access it
Closing Opening
brace brace
Java Basics
Class names Should be nouns
Java Basics
3.3 Methods
Java Basics
Methods definition
Parameter
We will Method s to the
Define who see this name method
can access later
the class:
public
means
everyone can
access it Return
type
Closing Opening
brace brace
Java Basics
Methods names Should be verbs
Good Examples:
• private static void play(int coinValue) {…}
Bad Examples
• public static void person() {…}
Java Basics
The main method is where your program start to
run
Is not necessary a
main method in a
class
Java Basics
3.4 Comments
Java Basics
Comments improve readability of source code
Self explanatory
Commented
code
Java Basics
3.5 Operators
3.5.1 Precedence of operators
3.5.2 Assignment operators
3.5.3 Increment and Decrement Operators
3.5.4 Logical Operators
Java Basics
3.5.1 Precedence of Operators
Java Basics
Precedence of arithmetic operators
Java Basics
Precedence of arithmetic operators
????
??
Java Basics
Precedence of arithmetic operators
Java Basics
3.5.2 Assignment Operators
Conditional OR (||)
selection repetition
if while
if…else do…while
switch for
I like my code !!
Eclipse NetBeans
???
??
Break
Continue