SlideShare a Scribd company logo
1 of 36
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
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
 
Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
 
programming concept
programming conceptprogramming concept
programming concept
 
2.3.tarek
2.3.tarek2.3.tarek
2.3.tarek
 
2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & Recovery
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recovery
 
Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++
 
Phases of-compiler
Phases of-compilerPhases of-compiler
Phases of-compiler
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Compiler design
Compiler designCompiler design
Compiler design
 
Phases of a Compiler
Phases of a CompilerPhases of a Compiler
Phases of a Compiler
 
Chapter 1 1
Chapter 1 1Chapter 1 1
Chapter 1 1
 
Advanced Java Topics
Advanced Java TopicsAdvanced Java Topics
Advanced Java Topics
 
Compiler construction
Compiler constructionCompiler construction
Compiler construction
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
 
Programming
ProgrammingProgramming
Programming
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 

Similar to 4 programming-using-java intro-tojava20102011

Java-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oopsJava-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oopsbuvanabala
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
 
java traning report_Summer.docx
java traning report_Summer.docxjava traning report_Summer.docx
java traning report_Summer.docxGauravSharma164138
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Sandeep Rawat
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting StartedRakesh Madugula
 
imperative programming language, java, android
imperative programming language, java, androidimperative programming language, java, android
imperative programming language, java, androidi i
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objectsvmadan89
 
Sybsc cs sem 3 core java
Sybsc cs sem 3 core javaSybsc cs sem 3 core java
Sybsc cs sem 3 core javaWE-IT TUTORIALS
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 
JVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfJVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfGeekster
 

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

Java notes
Java notesJava notes
Java notes
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
Java-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oopsJava-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oops
 
JAVA for Every one
JAVA for Every oneJAVA for Every one
JAVA for Every one
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
 
java traning report_Summer.docx
java traning report_Summer.docxjava traning report_Summer.docx
java traning report_Summer.docx
 
OOPS JAVA.pdf
OOPS JAVA.pdfOOPS JAVA.pdf
OOPS JAVA.pdf
 
Unit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdfUnit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdf
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting Started
 
imperative programming language, java, android
imperative programming language, java, androidimperative programming language, java, android
imperative programming language, java, android
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
Unit1 JAVA.pptx
Unit1 JAVA.pptxUnit1 JAVA.pptx
Unit1 JAVA.pptx
 
Sybsc cs sem 3 core java
Sybsc cs sem 3 core javaSybsc cs sem 3 core java
Sybsc cs sem 3 core java
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Core java
Core javaCore java
Core java
 
JVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfJVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdf
 
Java JDK.docx
Java JDK.docxJava JDK.docx
Java JDK.docx
 

More from 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 2Mahmoud Alfarra
 
Computer Programming, Loops using Java
Computer Programming, Loops using JavaComputer Programming, Loops using Java
Computer Programming, Loops using JavaMahmoud Alfarra
 
Chapter 10: hashing data structure
Chapter 10:  hashing data structureChapter 10:  hashing data structure
Chapter 10: hashing data structureMahmoud Alfarra
 
Chapter9 graph data structure
Chapter9  graph data structureChapter9  graph data structure
Chapter9 graph data structureMahmoud Alfarra
 
Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structureMahmoud Alfarra
 
Chapter 7: Queue data structure
Chapter 7:  Queue data structureChapter 7:  Queue data structure
Chapter 7: Queue data structureMahmoud Alfarra
 
Chapter 6: stack data structure
Chapter 6:  stack data structureChapter 6:  stack data structure
Chapter 6: stack data structureMahmoud Alfarra
 
Chapter 5: linked list data structure
Chapter 5: linked list data structureChapter 5: linked list data structure
Chapter 5: linked list data structureMahmoud 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 structureMahmoud 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 structureMahmoud 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 structureMahmoud Alfarra
 
Chapter1 intro toprincipleofc#_datastructure_b_cs
Chapter1  intro toprincipleofc#_datastructure_b_csChapter1  intro toprincipleofc#_datastructure_b_cs
Chapter1 intro toprincipleofc#_datastructure_b_csMahmoud Alfarra
 
Chapter 0: introduction to data structure
Chapter 0: introduction to data structureChapter 0: introduction to data structure
Chapter 0: introduction to data structureMahmoud 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 20102011Mahmoud Alfarra
 
5 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop201020115 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop20102011Mahmoud Alfarra
 
1 programming-using-java -introduction
1 programming-using-java -introduction1 programming-using-java -introduction
1 programming-using-java -introductionMahmoud 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 2Mahmoud Alfarra
 

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
 
Computer Programming, Loops using Java
Computer Programming, Loops using JavaComputer Programming, Loops using Java
Computer Programming, Loops using Java
 
Chapter 10: hashing data structure
Chapter 10:  hashing data structureChapter 10:  hashing data structure
Chapter 10: hashing data structure
 
Chapter9 graph data structure
Chapter9  graph data structureChapter9  graph data structure
Chapter9 graph data structure
 
Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structure
 
Chapter 7: Queue data structure
Chapter 7:  Queue data structureChapter 7:  Queue data structure
Chapter 7: Queue data structure
 
Chapter 6: stack data structure
Chapter 6:  stack data structureChapter 6:  stack data structure
Chapter 6: stack data structure
 
Chapter 5: linked list data structure
Chapter 5: linked list data structureChapter 5: linked list data structure
Chapter 5: linked list data structure
 
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
 
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
 
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
 
Chapter1 intro toprincipleofc#_datastructure_b_cs
Chapter1  intro toprincipleofc#_datastructure_b_csChapter1  intro toprincipleofc#_datastructure_b_cs
Chapter1 intro toprincipleofc#_datastructure_b_cs
 
Chapter 0: introduction to data structure
Chapter 0: introduction to data structureChapter 0: introduction to data structure
Chapter 0: introduction to data structure
 
3 classification
3  classification3  classification
3 classification
 
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
 
5 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop201020115 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop20102011
 
1 programming-using-java -introduction
1 programming-using-java -introduction1 programming-using-java -introduction
1 programming-using-java -introduction
 
تلخيص النصوص تلقائيا
تلخيص النصوص تلقائياتلخيص النصوص تلقائيا
تلخيص النصوص تلقائيا
 
4×4×4 لتحصيل التميز
4×4×4 لتحصيل التميز4×4×4 لتحصيل التميز
4×4×4 لتحصيل التميز
 
Data preparation and processing chapter 2
Data preparation and processing chapter  2Data preparation and processing chapter  2
Data preparation and processing chapter 2
 

Recently uploaded

MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

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 …
  • 14.
  • 15.
  • 16.
  • 17.
  • 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