SlideShare a Scribd company logo
Using Java
MINISTRY OF EDUCATION & HIGHER EDUCATION
COLLEGE OF SCIENCE AND TECHNOLOGY
KHANYOUNIS- PALESTINE
 First Program in Java
 Discussion of the main concepts
 Install the JDK and JCreator
 Memory Concepts and DataTypes
 Variables and Identifiers
 Arithmetic Operations
 Emank X Mezank
2Presented & Prepared by: Mahmoud R. Alfarra
 Computer programmers create applications
by writing computer programs.
 Your e-mail application helps you send and receive e-mail
 yourWeb browser lets you view Web pages fromWeb sites
around the world.
 A Java application is a computer program
that executes when you use the java
command to launch the JavaVirtual Machine
(JVM).
3Presented & Prepared by: Mahmoud R. Alfarra
 Let us consider a simple application that
displays a line of text using Java command.
4Presented & Prepared by: Mahmoud R. Alfarra
 Every program in Java consists of at least one
class declaration that is defined by the
programmer.
 These are known as programmer-defined
classes or user-defined classes.
5Presented & Prepared by: Mahmoud R. Alfarra
 Java class declarations normally contain one
or more methods.
 For a Java application, exactly one of the
methods must be called main and must be
defined as shown
6Presented & Prepared by: Mahmoud R. Alfarra
It is a syntax error if braces do not occur in matching
pairs
 Instructions perform an action namely, to
print the string of characters contained
between the double quotation marks.
 We refer to characters between double
quotation marks simply as strings.
7Presented & Prepared by: Mahmoud R. Alfarra
 Method System.out.println displays a line of text in
the command window.
 The string in the parentheses is the argument to the
method.
8Presented & Prepared by: Mahmoud R. Alfarra
 Method print displays one line of text in the
command window and position the cursor next
the last character.
 Println position the output cursor at the
beginning of the next line in the command.
 begins with // or between /* */, indicating
that the remainder of the line is a comment.
 The Java compiler ignores comments.
9Presented & Prepared by: Mahmoud R. Alfarra
10Presented & Prepared by: Mahmoud R. Alfarra
Java is case sensitive. Not using the proper uppercase and
lowercase letters for an identifier normally causes a
compilation error.
It is an error for a public class to have a file name that is not
identical to the class name (plus the .java extension) in terms
of both spelling and capitalization.
Omitting the semicolon at the end of a statement is a syntax
error.
 From the sun site
▪ http://java.sun.com/javase/downloads/index.jsp.
 download jdk-6-windows-i586.exe
 Setup normally (next then next …)
 But be care where it will be installed in your
PC
11Presented & Prepared by: Mahmoud R. Alfarra
12Presented & Prepared by: Mahmoud R. Alfarra
 From the site of Jcreator or my web site
▪ http://www.jcreator.com/
▪ Staff.cst.ps/mfarra
 Download the JCreator Pro
 And then trace the following slides to setup …
‫إعداد‬/‫أ‬.
‫رفيق‬ ‫حممود‬
‫ا‬‫ر‬‫الف‬ ‫محدي‬
2010-
2011
4 programming-using-java intro-tojava20102011
4 programming-using-java intro-tojava20102011
4 programming-using-java intro-tojava20102011
4 programming-using-java intro-tojava20102011
1
2
3
4
5
6
7
Install the JDK and JCreator on your PC at home,
and then write a program that prints your name, ID,
GPA, addressHW 4.1
 Identifiers are names used to identify
variables, methods, classes …
 An identifier consist of letters,numbers, _ , $
 But must:
 Begin with letter.
 not contain space.
 not a reserved word
21Presented & Prepared by: Mahmoud R. Alfarra
 A variable is a location in the computer's
memory where a value can be stored for use
later in a program.
 All variables must be declared with a name
and a type before they can be used.
22Presented & Prepared by: Mahmoud R. Alfarra
Data type Identifiers
 Data types in Java are divided into two
categories primitive types and reference.
 A primitive-type variable can store exactly
one value of its declared type at a time.
 Every variable has a name, a type, a size and
a value.
23Presented & Prepared by: Mahmoud R. Alfarra
24Presented & Prepared by: Mahmoud R. Alfarra
0 0 0 1 1 1 0 0 ‫الذكرة‬ ‫من‬‫مقطع‬
‫يتم‬‫التعريف‬ ‫هذا‬ ‫بمجرد‬
‫الذاكرة‬ ‫في‬ ‫مساحة‬ ‫تخصيص‬
‫يناس‬ ‫بحجم‬‫بيانات‬ ‫لتخزين‬‫ب‬
‫اد‬‫ر‬‫امل‬‫النوع‬
Type1 x = 28 ; // ‫سعتها‬ ‫الذاكرة‬ ‫في‬ ‫مساحة‬‫تخصيص‬ ‫سيتم‬1‫بايت‬
Type2 y; // ‫سعتها‬ ‫الذاكرة‬ ‫في‬ ‫مساحة‬‫تخصيص‬ ‫سيتم‬2‫بايت‬
25Presented & Prepared by: Mahmoud R. Alfarra
TypeValues examplesSize
booleantrue, false1 Byte
char‘b’, ‘c’ , ‘t’, ‘5’, …2 byte
byte128, 0, 34, …1 byte
short32768, 67, 342 byte
int2147483648 , 7, 9, 0, …4 byte
long9223372036854775808, 878, …8 byte
float- 3.5, 234.56, …4 byte
double-2345.34, …8 byte
 Most programs perform arithmetic calculations.
 The arithmetic operators are
26Presented & Prepared by: Mahmoud R. Alfarra
 Java applies the operators in arithmetic expressions
in a precise sequence determined by the following
rules of operator precedence:
27Presented & Prepared by: Mahmoud R. Alfarra
28Presented & Prepared by: Mahmoud R. Alfarra
29Presented & Prepared by: Mahmoud R. Alfarra
30Presented & Prepared by: Mahmoud R. Alfarra
Some common escape sequences
31Presented & Prepared by: Mahmoud R. Alfarra
32Presented & Prepared by: Mahmoud R. Alfarra
33Presented & Prepared by: Mahmoud R. Alfarra
34Presented & Prepared by: Mahmoud R. Alfarra
‫تعاىل‬ ‫هللا‬ ‫قال‬:
(ِ‫ج‬‫لل‬ِ‫ِب‬ ‫ج‬‫ن‬‫نو‬ِ‫ؤم‬ُ‫ي‬ ً‫ا‬‫وم‬‫ج‬‫ق‬ ُ‫د‬ِ‫ج‬‫َت‬ ‫ال‬ِ‫ر‬‫ر‬ِ‫خ‬‫ج‬‫أل‬‫ا‬ ِ‫وم‬‫ج‬‫الي‬‫ج‬‫و‬‫ج‬‫ن‬‫و‬‫و‬‫د‬‫روا‬ُ‫ي‬
ُ‫ه‬‫ج‬‫ل‬‫سو‬‫ج‬‫ر‬‫ج‬‫و‬ ‫ج‬‫ج‬‫الل‬ َّ‫حاد‬ ‫ن‬‫ج‬‫م‬)
35Presented & Prepared by: Mahmoud R. Alfarra
Introduction
to OOP
36Presented & Prepared by: Mahmoud R. Alfarra

More Related Content

What's hot (20)

Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
mshoaib15
 
Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
mshoaib15
 
programming concept
programming conceptprogramming concept
programming concept
Nehabhy
 
2.3.tarek
2.3.tarek2.3.tarek
2.3.tarek
afacct
 
2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment
CarlosPineda729332
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
Anbarasan Gangadaran
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & Recovery
Akhil Kaushik
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recovery
Tech_MX
 
Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++
Salahaddin University-Erbil
 
Phases of-compiler
Phases of-compilerPhases of-compiler
Phases of-compiler
Zahidul Islam Razu
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
umardanjumamaiwada
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
A. S. M. Shafi
 
Compiler design
Compiler designCompiler design
Compiler design
nazmul hoque
 
Phases of a Compiler
Phases of a CompilerPhases of a Compiler
Phases of a Compiler
University of Saskatchewan
 
Chapter 1 1
Chapter 1 1Chapter 1 1
Chapter 1 1
bolovv
 
Advanced Java Topics
Advanced Java TopicsAdvanced Java Topics
Advanced Java Topics
Salahaddin University-Erbil
 
Compiler construction
Compiler constructionCompiler construction
Compiler construction
Muhammed Afsal Villan
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
Prof. Dr. K. Adisesha
 
Programming
ProgrammingProgramming
Programming
Alawi Alradhi
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
Karan Deopura
 

Similar to 4 programming-using-java intro-tojava20102011 (20)

Presentation on programming language on java.ppt
Presentation on programming language on java.pptPresentation on programming language on java.ppt
Presentation on programming language on java.ppt
HimambashaShaik
 
lecture 6
 lecture 6 lecture 6
lecture 6
umardanjumamaiwada
 
LECTURE 2 -Object oriented Java Basics.pptx
LECTURE 2 -Object oriented  Java Basics.pptxLECTURE 2 -Object oriented  Java Basics.pptx
LECTURE 2 -Object oriented Java Basics.pptx
AOmaAli
 
CSL101_Ch1.ppt Computer Science
CSL101_Ch1.ppt          Computer ScienceCSL101_Ch1.ppt          Computer Science
CSL101_Ch1.ppt Computer Science
kavitamittal18
 
Programming with Java by Faizan Ahmed & Team
Programming with Java by Faizan Ahmed & TeamProgramming with Java by Faizan Ahmed & Team
Programming with Java by Faizan Ahmed & Team
FaizanAhmed272398
 
Introduction to java programming with Fundamentals
Introduction to java programming with FundamentalsIntroduction to java programming with Fundamentals
Introduction to java programming with Fundamentals
rajipe1
 
Mobile computing for Bsc Computer Science
Mobile computing for Bsc Computer ScienceMobile computing for Bsc Computer Science
Mobile computing for Bsc Computer Science
ReshmiGopinath4
 
Programming with Java - Essentials to program
Programming with Java - Essentials to programProgramming with Java - Essentials to program
Programming with Java - Essentials to program
leaderHilali1
 
a basic java programming and data type.ppt
a basic java programming and data type.ppta basic java programming and data type.ppt
a basic java programming and data type.ppt
GevitaChinnaiah
 
M251_Meeting 1(M251_Meeting 1_updated.pdf)
M251_Meeting 1(M251_Meeting 1_updated.pdf)M251_Meeting 1(M251_Meeting 1_updated.pdf)
M251_Meeting 1(M251_Meeting 1_updated.pdf)
hossamghareb681
 
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBBJAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
NagarathnaRajur2
 
java handout.doc
java handout.docjava handout.doc
java handout.doc
SOMOSCO1
 
Java
JavaJava
Java
Sneha Mudraje
 
CSL101_Ch1.ppt
CSL101_Ch1.pptCSL101_Ch1.ppt
CSL101_Ch1.ppt
kavitamittal18
 
CSL101_Ch1.ppt
CSL101_Ch1.pptCSL101_Ch1.ppt
CSL101_Ch1.ppt
DrPriyaChittibabu
 
CSL101_Ch1.pptx
CSL101_Ch1.pptxCSL101_Ch1.pptx
CSL101_Ch1.pptx
shivanka2
 
CSL101_Ch1.pptx
CSL101_Ch1.pptxCSL101_Ch1.pptx
CSL101_Ch1.pptx
Ashwani Kumar
 
java tutorial for beginners learning.ppt
java tutorial for beginners learning.pptjava tutorial for beginners learning.ppt
java tutorial for beginners learning.ppt
usha852
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)
Dr. SURBHI SAROHA
 
Let's start with Java- Basic Concepts
Let's start with Java- Basic ConceptsLet's start with Java- Basic Concepts
Let's start with Java- Basic Concepts
Aashish Jain
 
Presentation on programming language on java.ppt
Presentation on programming language on java.pptPresentation on programming language on java.ppt
Presentation on programming language on java.ppt
HimambashaShaik
 
LECTURE 2 -Object oriented Java Basics.pptx
LECTURE 2 -Object oriented  Java Basics.pptxLECTURE 2 -Object oriented  Java Basics.pptx
LECTURE 2 -Object oriented Java Basics.pptx
AOmaAli
 
CSL101_Ch1.ppt Computer Science
CSL101_Ch1.ppt          Computer ScienceCSL101_Ch1.ppt          Computer Science
CSL101_Ch1.ppt Computer Science
kavitamittal18
 
Programming with Java by Faizan Ahmed & Team
Programming with Java by Faizan Ahmed & TeamProgramming with Java by Faizan Ahmed & Team
Programming with Java by Faizan Ahmed & Team
FaizanAhmed272398
 
Introduction to java programming with Fundamentals
Introduction to java programming with FundamentalsIntroduction to java programming with Fundamentals
Introduction to java programming with Fundamentals
rajipe1
 
Mobile computing for Bsc Computer Science
Mobile computing for Bsc Computer ScienceMobile computing for Bsc Computer Science
Mobile computing for Bsc Computer Science
ReshmiGopinath4
 
Programming with Java - Essentials to program
Programming with Java - Essentials to programProgramming with Java - Essentials to program
Programming with Java - Essentials to program
leaderHilali1
 
a basic java programming and data type.ppt
a basic java programming and data type.ppta basic java programming and data type.ppt
a basic java programming and data type.ppt
GevitaChinnaiah
 
M251_Meeting 1(M251_Meeting 1_updated.pdf)
M251_Meeting 1(M251_Meeting 1_updated.pdf)M251_Meeting 1(M251_Meeting 1_updated.pdf)
M251_Meeting 1(M251_Meeting 1_updated.pdf)
hossamghareb681
 
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBBJAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
NagarathnaRajur2
 
java handout.doc
java handout.docjava handout.doc
java handout.doc
SOMOSCO1
 
CSL101_Ch1.pptx
CSL101_Ch1.pptxCSL101_Ch1.pptx
CSL101_Ch1.pptx
shivanka2
 
java tutorial for beginners learning.ppt
java tutorial for beginners learning.pptjava tutorial for beginners learning.ppt
java tutorial for beginners learning.ppt
usha852
 
Let's start with Java- Basic Concepts
Let's start with Java- Basic ConceptsLet's start with Java- Basic Concepts
Let's start with Java- Basic Concepts
Aashish Jain
 
Ad

More from Mahmoud Alfarra (20)

Computer Programming, Loops using Java - part 2
Computer Programming, Loops using Java - part 2Computer Programming, Loops using Java - part 2
Computer Programming, Loops using Java - part 2
Mahmoud Alfarra
 
Computer Programming, Loops using Java
Computer Programming, Loops using JavaComputer Programming, Loops using Java
Computer Programming, Loops using Java
Mahmoud Alfarra
 
Chapter 10: hashing data structure
Chapter 10:  hashing data structureChapter 10:  hashing data structure
Chapter 10: hashing data structure
Mahmoud Alfarra
 
Chapter9 graph data structure
Chapter9  graph data structureChapter9  graph data structure
Chapter9 graph data structure
Mahmoud Alfarra
 
Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structure
Mahmoud Alfarra
 
Chapter 7: Queue data structure
Chapter 7:  Queue data structureChapter 7:  Queue data structure
Chapter 7: Queue data structure
Mahmoud Alfarra
 
Chapter 6: stack data structure
Chapter 6:  stack data structureChapter 6:  stack data structure
Chapter 6: stack data structure
Mahmoud Alfarra
 
Chapter 5: linked list data structure
Chapter 5: linked list data structureChapter 5: linked list data structure
Chapter 5: linked list data structure
Mahmoud Alfarra
 
Chapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structureChapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structure
Mahmoud Alfarra
 
Chapter 3: basic sorting algorithms data structure
Chapter 3: basic sorting algorithms data structureChapter 3: basic sorting algorithms data structure
Chapter 3: basic sorting algorithms data structure
Mahmoud Alfarra
 
Chapter 2: array and array list data structure
Chapter 2: array and array list  data structureChapter 2: array and array list  data structure
Chapter 2: array and array list data structure
Mahmoud Alfarra
 
Chapter1 intro toprincipleofc#_datastructure_b_cs
Chapter1  intro toprincipleofc#_datastructure_b_csChapter1  intro toprincipleofc#_datastructure_b_cs
Chapter1 intro toprincipleofc#_datastructure_b_cs
Mahmoud Alfarra
 
Chapter 0: introduction to data structure
Chapter 0: introduction to data structureChapter 0: introduction to data structure
Chapter 0: introduction to data structure
Mahmoud Alfarra
 
3 classification
3  classification3  classification
3 classification
Mahmoud Alfarra
 
8 programming-using-java decision-making practices 20102011
8 programming-using-java decision-making practices 201020118 programming-using-java decision-making practices 20102011
8 programming-using-java decision-making practices 20102011
Mahmoud Alfarra
 
5 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop201020115 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop20102011
Mahmoud Alfarra
 
1 programming-using-java -introduction
1 programming-using-java -introduction1 programming-using-java -introduction
1 programming-using-java -introduction
Mahmoud Alfarra
 
تلخيص النصوص تلقائيا
تلخيص النصوص تلقائياتلخيص النصوص تلقائيا
تلخيص النصوص تلقائيا
Mahmoud Alfarra
 
4×4×4 لتحصيل التميز
4×4×4 لتحصيل التميز4×4×4 لتحصيل التميز
4×4×4 لتحصيل التميز
Mahmoud Alfarra
 
Data preparation and processing chapter 2
Data preparation and processing chapter  2Data preparation and processing chapter  2
Data preparation and processing chapter 2
Mahmoud Alfarra
 
Computer Programming, Loops using Java - part 2
Computer Programming, Loops using Java - part 2Computer Programming, Loops using Java - part 2
Computer Programming, Loops using Java - part 2
Mahmoud Alfarra
 
Computer Programming, Loops using Java
Computer Programming, Loops using JavaComputer Programming, Loops using Java
Computer Programming, Loops using Java
Mahmoud Alfarra
 
Chapter 10: hashing data structure
Chapter 10:  hashing data structureChapter 10:  hashing data structure
Chapter 10: hashing data structure
Mahmoud Alfarra
 
Chapter9 graph data structure
Chapter9  graph data structureChapter9  graph data structure
Chapter9 graph data structure
Mahmoud Alfarra
 
Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structure
Mahmoud Alfarra
 
Chapter 7: Queue data structure
Chapter 7:  Queue data structureChapter 7:  Queue data structure
Chapter 7: Queue data structure
Mahmoud Alfarra
 
Chapter 6: stack data structure
Chapter 6:  stack data structureChapter 6:  stack data structure
Chapter 6: stack data structure
Mahmoud Alfarra
 
Chapter 5: linked list data structure
Chapter 5: linked list data structureChapter 5: linked list data structure
Chapter 5: linked list data structure
Mahmoud Alfarra
 
Chapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structureChapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structure
Mahmoud Alfarra
 
Chapter 3: basic sorting algorithms data structure
Chapter 3: basic sorting algorithms data structureChapter 3: basic sorting algorithms data structure
Chapter 3: basic sorting algorithms data structure
Mahmoud Alfarra
 
Chapter 2: array and array list data structure
Chapter 2: array and array list  data structureChapter 2: array and array list  data structure
Chapter 2: array and array list data structure
Mahmoud Alfarra
 
Chapter1 intro toprincipleofc#_datastructure_b_cs
Chapter1  intro toprincipleofc#_datastructure_b_csChapter1  intro toprincipleofc#_datastructure_b_cs
Chapter1 intro toprincipleofc#_datastructure_b_cs
Mahmoud Alfarra
 
Chapter 0: introduction to data structure
Chapter 0: introduction to data structureChapter 0: introduction to data structure
Chapter 0: introduction to data structure
Mahmoud Alfarra
 
8 programming-using-java decision-making practices 20102011
8 programming-using-java decision-making practices 201020118 programming-using-java decision-making practices 20102011
8 programming-using-java decision-making practices 20102011
Mahmoud Alfarra
 
5 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop201020115 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop20102011
Mahmoud Alfarra
 
1 programming-using-java -introduction
1 programming-using-java -introduction1 programming-using-java -introduction
1 programming-using-java -introduction
Mahmoud Alfarra
 
تلخيص النصوص تلقائيا
تلخيص النصوص تلقائياتلخيص النصوص تلقائيا
تلخيص النصوص تلقائيا
Mahmoud Alfarra
 
4×4×4 لتحصيل التميز
4×4×4 لتحصيل التميز4×4×4 لتحصيل التميز
4×4×4 لتحصيل التميز
Mahmoud Alfarra
 
Data preparation and processing chapter 2
Data preparation and processing chapter  2Data preparation and processing chapter  2
Data preparation and processing chapter 2
Mahmoud Alfarra
 
Ad

Recently uploaded (20)

Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
National Information Standards Organization (NISO)
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 

4 programming-using-java intro-tojava20102011

  • 1. Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE
  • 2.  First Program in Java  Discussion of the main concepts  Install the JDK and JCreator  Memory Concepts and DataTypes  Variables and Identifiers  Arithmetic Operations  Emank X Mezank 2Presented & Prepared by: Mahmoud R. Alfarra
  • 3.  Computer programmers create applications by writing computer programs.  Your e-mail application helps you send and receive e-mail  yourWeb browser lets you view Web pages fromWeb sites around the world.  A Java application is a computer program that executes when you use the java command to launch the JavaVirtual Machine (JVM). 3Presented & Prepared by: Mahmoud R. Alfarra
  • 4.  Let us consider a simple application that displays a line of text using Java command. 4Presented & Prepared by: Mahmoud R. Alfarra
  • 5.  Every program in Java consists of at least one class declaration that is defined by the programmer.  These are known as programmer-defined classes or user-defined classes. 5Presented & Prepared by: Mahmoud R. Alfarra
  • 6.  Java class declarations normally contain one or more methods.  For a Java application, exactly one of the methods must be called main and must be defined as shown 6Presented & Prepared by: Mahmoud R. Alfarra It is a syntax error if braces do not occur in matching pairs
  • 7.  Instructions perform an action namely, to print the string of characters contained between the double quotation marks.  We refer to characters between double quotation marks simply as strings. 7Presented & Prepared by: Mahmoud R. Alfarra
  • 8.  Method System.out.println displays a line of text in the command window.  The string in the parentheses is the argument to the method. 8Presented & Prepared by: Mahmoud R. Alfarra  Method print displays one line of text in the command window and position the cursor next the last character.  Println position the output cursor at the beginning of the next line in the command.
  • 9.  begins with // or between /* */, indicating that the remainder of the line is a comment.  The Java compiler ignores comments. 9Presented & Prepared by: Mahmoud R. Alfarra
  • 10. 10Presented & Prepared by: Mahmoud R. Alfarra Java is case sensitive. Not using the proper uppercase and lowercase letters for an identifier normally causes a compilation error. It is an error for a public class to have a file name that is not identical to the class name (plus the .java extension) in terms of both spelling and capitalization. Omitting the semicolon at the end of a statement is a syntax error.
  • 11.  From the sun site ▪ http://java.sun.com/javase/downloads/index.jsp.  download jdk-6-windows-i586.exe  Setup normally (next then next …)  But be care where it will be installed in your PC 11Presented & Prepared by: Mahmoud R. Alfarra
  • 12. 12Presented & Prepared by: Mahmoud R. Alfarra  From the site of Jcreator or my web site ▪ http://www.jcreator.com/ ▪ Staff.cst.ps/mfarra  Download the JCreator Pro  And then trace the following slides to setup …
  • 19. 5 6
  • 20. 7 Install the JDK and JCreator on your PC at home, and then write a program that prints your name, ID, GPA, addressHW 4.1
  • 21.  Identifiers are names used to identify variables, methods, classes …  An identifier consist of letters,numbers, _ , $  But must:  Begin with letter.  not contain space.  not a reserved word 21Presented & Prepared by: Mahmoud R. Alfarra
  • 22.  A variable is a location in the computer's memory where a value can be stored for use later in a program.  All variables must be declared with a name and a type before they can be used. 22Presented & Prepared by: Mahmoud R. Alfarra Data type Identifiers
  • 23.  Data types in Java are divided into two categories primitive types and reference.  A primitive-type variable can store exactly one value of its declared type at a time.  Every variable has a name, a type, a size and a value. 23Presented & Prepared by: Mahmoud R. Alfarra
  • 24. 24Presented & Prepared by: Mahmoud R. Alfarra 0 0 0 1 1 1 0 0 ‫الذكرة‬ ‫من‬‫مقطع‬ ‫يتم‬‫التعريف‬ ‫هذا‬ ‫بمجرد‬ ‫الذاكرة‬ ‫في‬ ‫مساحة‬ ‫تخصيص‬ ‫يناس‬ ‫بحجم‬‫بيانات‬ ‫لتخزين‬‫ب‬ ‫اد‬‫ر‬‫امل‬‫النوع‬ Type1 x = 28 ; // ‫سعتها‬ ‫الذاكرة‬ ‫في‬ ‫مساحة‬‫تخصيص‬ ‫سيتم‬1‫بايت‬ Type2 y; // ‫سعتها‬ ‫الذاكرة‬ ‫في‬ ‫مساحة‬‫تخصيص‬ ‫سيتم‬2‫بايت‬
  • 25. 25Presented & Prepared by: Mahmoud R. Alfarra TypeValues examplesSize booleantrue, false1 Byte char‘b’, ‘c’ , ‘t’, ‘5’, …2 byte byte128, 0, 34, …1 byte short32768, 67, 342 byte int2147483648 , 7, 9, 0, …4 byte long9223372036854775808, 878, …8 byte float- 3.5, 234.56, …4 byte double-2345.34, …8 byte
  • 26.  Most programs perform arithmetic calculations.  The arithmetic operators are 26Presented & Prepared by: Mahmoud R. Alfarra
  • 27.  Java applies the operators in arithmetic expressions in a precise sequence determined by the following rules of operator precedence: 27Presented & Prepared by: Mahmoud R. Alfarra
  • 28. 28Presented & Prepared by: Mahmoud R. Alfarra
  • 29. 29Presented & Prepared by: Mahmoud R. Alfarra
  • 30. 30Presented & Prepared by: Mahmoud R. Alfarra Some common escape sequences
  • 31. 31Presented & Prepared by: Mahmoud R. Alfarra
  • 32. 32Presented & Prepared by: Mahmoud R. Alfarra
  • 33. 33Presented & Prepared by: Mahmoud R. Alfarra
  • 34. 34Presented & Prepared by: Mahmoud R. Alfarra
  • 35. ‫تعاىل‬ ‫هللا‬ ‫قال‬: (ِ‫ج‬‫لل‬ِ‫ِب‬ ‫ج‬‫ن‬‫نو‬ِ‫ؤم‬ُ‫ي‬ ً‫ا‬‫وم‬‫ج‬‫ق‬ ُ‫د‬ِ‫ج‬‫َت‬ ‫ال‬ِ‫ر‬‫ر‬ِ‫خ‬‫ج‬‫أل‬‫ا‬ ِ‫وم‬‫ج‬‫الي‬‫ج‬‫و‬‫ج‬‫ن‬‫و‬‫و‬‫د‬‫روا‬ُ‫ي‬ ُ‫ه‬‫ج‬‫ل‬‫سو‬‫ج‬‫ر‬‫ج‬‫و‬ ‫ج‬‫ج‬‫الل‬ َّ‫حاد‬ ‫ن‬‫ج‬‫م‬) 35Presented & Prepared by: Mahmoud R. Alfarra
  • 36. Introduction to OOP 36Presented & Prepared by: Mahmoud R. Alfarra