Chapter 1 - Introduction To Computers, Programs, and Java - Lecture2
Chapter 1 - Introduction To Computers, Programs, and Java - Lecture2
Lecture 2
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Objectives
F To understand computer basics, programs, and operating systems (§§1.2–1.4).
F To understand the meaning of Java language specification, API, JDK, and IDE
(§1.6).
F To write a simple Java program (§1.7).
F To display output on the console (§1.7).
F To explain the basic syntax of a Java program (§1.7).
F To create, compile, and run Java programs (§1.8).
F To use sound Java programming style and document programs properly (§1.9).
F To explain the differences between syntax errors, runtime errors, and logic
errors (§1.10).
F To develop Java programs using NetBeans (§1.11).
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
What is a Computer?
A computer consists of a CPU, tomemory, storage devices, input i D
2450 Ww1
at
4141 so
Y
ay
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
041st'm 1 CPU
1 as 11 a
The central processing unit (CPU) is the brain of a computer. It
4 a u o
retrieves instructions from memory and executes them. The CPU
speed is measured in megahertz (MHz), with 1 megahertz equaling 1
million pulses per second. The speed of the CPU has been improved
Jw 1 Core I9 (18-Core) with
continuously. You can get an Intel Processor
3 gigahertz speed (1 gigahertz is 1000 megahertz). JI JA
N of
RAM
JAI
5 I
MINI
I
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Jill J T
How Data is Stored?
Data are encoded as a series of bits (zeros
and ones). يتم ترميز البيانات على شكل سلسلة من البتات
.()األصفار واآلحاد
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
251051
Storage Devices
Tyto of thsu I w
Memory is volatile, because information is lost when the power is
I off. Programs and data are permanently
t's stored on storage devices
and are moved to memory when the computer actually uses them.
dei of storage devices:Disk drives (hard disks
There are three main types
and floppy disks), CD drives (CD-R and CD-RW), and Tape drives.
D
5011 d y
pm
OH YI
يتم تخزين. ألن املعلومات تُفقد عند انقطاع التيار الكهربائي، الذاكرة متقلبة
البرامج والبيانات بشكل دائم على أجهزة التخزين ويتم نقلها إلى الذاكرة عندما
محركات: هناك ثالثة أنواع رئيسية من أجهزة التخزين.يستخدمها الكمبيوتر بالفعل
CD-R) األقراص )األقراص الثابتة واألقراص املرنة( ومحركات األقراص املضغوطة
.( ومحركات األقراصCD-RW و
tafask
All rights reserved.
IIYE.no
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
3 A
0
we
Output Devices: Monitor
Idl
The monitor displays information (text and graphics). The resolution
and dot pitch determine the quality of the display.
. تحدد النقاط درجة الدقة و جودة العرض.(تعرض الشاشة معلومات )نصوص ورسومات
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
C 09
Monitor Resolution and Dot Pitch
.ووضوحا وضوحا كانت الصورة أكثر، كلما زادت الدقة.تحدد دقة الشاشة عدد البكسل باألبعاد األفقية والرأسية لجهاز العرض
ً ً
resolution The screen resolution specifies the number of pixels in
horizontal and vertical dimensions of the display device.
The higher the resolution, the sharper and clearer the image
is. US l
IN J t.W.tl
gooo
saw
2531,1 sad
dot pitch The dot pitch is the amount of space between pixels,
measured in millimeters. The smaller the dot pitch, the
sharper the display.
زادت، كلما كانت درجة النقطة أصغر. وتُقاس باملليمترات، خطوة النقطة هي مقدار املسافة بني البيكسالت
.حدة الشاشة
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Ma pi I
Communication Devices
A regular modem uses a phone line and can transfer data in a speed up to
56,000 bps (bits per second).
II I
Network interface card (NIC) is a device to connect a computer to a local
area network (LAN).
بت في الثانية )بت56000 يستخدم املودم العادي خط هاتف ويمكنه نقل البيانات بسرعة تصل إلى
.(في الثانية
.(LAN) ( هي جهاز لتوصيل جهاز كمبيوتر بشبكة محليةNIC) بطاقة واجهة الشبكة
got
Imy
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Programs 2913
Computer programs, known as software, are Ld to
instructions
—
the computer. . هي إرشادات للكمبيوتر، املعروفة باسم البرامج، برامج الكمبيوتر
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Programming Languages
I u 019
Machine Language pmAssembly Language High-Level Language
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Programming Languages
Machine Language Assembly Language High-Level Language
3 I a
_i
يتم استخدام برنامج يسمى املجمع لتحويل، نظرا ألن الكمبيوتر ال يستطيع فهم لغة التجميع ً .تم تطوير لغات التجميع لجعل البرمجة سهلة
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
ADDF3 R1، R2، :كتابة تعليمات في كود التجميع مثل هذا يمكنك، إلضافة رقمني، على سبيل املثال.برامج لغة التجميع إلى رمز الجهاز
All rights reserved.
0
Programming Languages
Machine Language Assembly Language As High-Level Language
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Popular High-Level Languages
Its
W
Swt
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
25 ps 1
I
Interpreting/Compiling Source Code
A program written in a high-level language is called
a source program or source code. Because a
computer cannot understand a source program, a
source program must be translated into machine
is I
code for execution. The translation can be done
using another programming tool called an
interpreter or a compiler.
نظرا ألن الكمبيوتر ال يمكنه
ً .يُطلق على البرنامج املكتوب بلغة عالية املستوى اسم البرنامج املصدر أو الكود املصدري
يمكن أن تتم الترجمة باستخدام أداة. يجب ترجمة البرنامج املصدر إلى رمز الجهاز للتنفيذ، فهم البرنامج املصدر
.برمجة أخرى تسمى مترجم أو مترجم
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
095
see
Interpreting Source Code
An interpreter reads one statement from the source
code, translates it to the machine code and then
executes it right away A W
ويترجمه إلى رمز الجهاز ثم ينفذه على الفور، يقرأ املترجم بيانًا واح ًدا من الكود املصدري
WI
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Say Compiling Source Code
A compiler translates the entire source code into a
machine-code file, and the machine-code file is then
executed, as shown in the following figure.
. كما هو موضح في الشكل التالي، ثم يتم تنفيذ ملف كود اآللة، يترجم املترجم شفرة املصدر بالكامل إلى ملف كود اآللة
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
III
Operating Systems
The operating system (OS) is a
program that manages and controls
a computer’s activities. The
popular operating systems for O
ye
general-purpose computers
are Microsoft Windows, Mac
u
OS, and sLinux. Application
programs, such as a Web int
browser or a word processor,
cannot run unless an
s
operating system is installed 6551,69
and running on the computer. 8,81
أنظمة التشغيل الشائعة ألجهزة الكمبيوتر ذات األغراض العامة هي.( هو برنامج يدير أنشطة الكمبيوتر ويتحكم فيهاOS) نظام التشغيل
ما لم يتم، مثل مستعرض الويب أو معالج النصوص، ال يمكن تشغيل برامج التطبيقات.Linux وMac OS وMicrosoft Windows
.تثبيت نظام التشغيل وتشغيله على الكمبيوتر
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
تمكن املستخدمني منJava اإلجابة هي أن
تطوير ونشر التطبيقات على اإلنترنت للخوادم
وأجهزة الكمبيوتر املكتبية واألجهزة املحمولة Why Java?
الصغيرة
411645 1 3
I 9
283.1 MME
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
00 112153
Java, Web, and Beyond
I
D
F Java can be used to develop standalone
applications. .التطبيقات٠ لتطوير قائمة بذاتهاJava يمكن استخدام
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
x Java’s History
F James Gosling and Sun Microsystems
F Java, May 20, 1995, Sun World
http://www.java.com/en/javahistory/index.jsp
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion 611 17
Website
Characteristics of Java
F Java Is Simple Java is partially modeled on C++, but greatly
simplified and improved. Some people refer to
F Java Is Object-Oriented Java as "C++--" because it is like C++ but
F Java Is Distributed with more functionality and fewer negative
aspects.
F Java Is Interpreted + C جزئ ًيا على طرازJava تم تصميم eat Ntt
F Java Is Robust ولكن تم تبسيطها وتحسينها بشكل، +
يشير بعض األشخاص إلى.كبير
F Java Is Secure + C " ألنها تشبه- ++ C" باسمJava
ولكن مع وظائف أكثر وجوانب سلبية+
F Java Is Architecture-Neutral .أقل
F Java Is Portable
F Java's Performance
F Java Is Multithreaded
F Java Is Dynamic
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
( هي نهج برمجة شائع يحل محل تقنيات البرمجة اإلجرائيةOOP) البرمجة الشيئية. من البداية ليكون موج ًها للكائناتJava تم تصميم
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
F Java Is Simple Distributed computing involves several
computers working together on a network.
F Java Is Object-Oriented Java is designed to make distributed
F Java Is Distributed computing easy.
F Java Is Interpreted
F Java Is Robust
II Es I 21st
تتضمن الحوسبة املوزعة عدة أجهزة كمبيوتر تعمل م ًعا
F Java Is Secure لجعل الحوسبة املوزعةJava تم تصميم.على شبكة
.سهلة
F Java Is Architecture-Neutral
F Java Is Portable
F Java's Performance
F Java Is Multithreaded
F Java Is Dynamic
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
F Java Is Simple The programs are compiled into the Java
Virtual Machine code called bytecode. The
F Java Is Object-Oriented bytecode is machine-independent and can
F Java Is Distributed run on any machine that has a Java
interpreter, which is part of the Java
F Java Is Interpreted Virtual Machine (JVM).
F Java Is Robust Java Virtual يتم تجميع البرامج في كود
الرمز الثانوي.bytecode املسمىMachine
F Java Is Secure مستقل عن اآللة ويمكن تشغيله على أي جهاز يحتوي
F Java Is Architecture-Neutral Java Virtual وهو جزء من، Java على مترجم
.Machine (JVM)
F Java Is Portable
F Java's Performance
F Java Is Multithreaded
F Java Is Dynamic
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java .يمكن ملجمعي جافا اكتشاف العديد من املشكالت
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
F Java Is Simple
F Java Is Object-Oriented
F Java Is Distributed
F Java Is Interpreted
Java implements several security
F Java Is Robust mechanisms to protect your system against
harm caused by stray programs.
F Java Is Secure .جافا آمنة
هيF Java بتنفيذ العديد من األمانJava تقوم
F Java Is Architecture-Neutral هو الضررF Java آليات قوية لحماية نظامك من
.اآلمن الناجم عن البرامج الضالة
F Java Is Portable
F Java's Performance
F Java Is Multithreaded
F Java Is Dynamic
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
F Java Is Simple
F Java Is Object-Oriented
F Java Is Distributed
F Java Is Interpreted
F Java Is Robust
F Java Is Secure
جافا هندسة معمارية محايدة
F Java Is Architecture-Neutral Write once, run anywhere
F Java Is Portable With a Java Virtual Machine (JVM), you
can write one program that will run on any
F Java's Performance
platform.
F Java Is Multithreaded وقم بالتشغيل في أي مكان باستخدام، اكتب مرة واحدة
يمكنك كتابة برنامج، Java Virtual Machine (JVM)
F Java Is Dynamic .واحد يعمل على أي نظام أساسي
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
F Java Is Simple
F Java Is Object-Oriented
F Java Is Distributed
F Java Is Interpreted
F Java Is Robust
F Java Is Secure
F Java Is Architecture-Neutral يمكن تشغيلها على أي منصة
جافا محمولة
They can be run on any platform
F Java Is Portable
F Java's Performance
F Java Is Multithreaded
F Java Is Dynamic
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
F Java Is Simple
F Java Is Object-Oriented
F Java Is Distributed
F Java Is Interpreted
F Java Is Robust
F Java Is Secure
F Java Is Architecture-Neutral
They can be run on any platform without
F Java Is Portable
أداء جافا being recompiled.
F Java's Performance .يمكن تشغيلها على أي منصة دون إعادة تجميعها
F Java Is Multithreaded
F Java Is Dynamic
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
Characteristics of Java
F Java Is Simple
F Java Is Object-Oriented
F Java Is Distributed
F Java Is Interpreted
F Java Is Robust
F Java Is Secure
F Java Is Architecture-Neutral
F Java Is Portable جافا متعددة مؤشرات الترابط متكاملة في جافا
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Companion
Website
جافا بسيطة
Characteristics of Java
F Java Is Simple
جافا هي وجوه املنحى
F Java Is Object-Oriented
Java يتم توزيع
F Java Is Distributed
يتم تفسير جافا
F Java Is Interpreted
جافا قوية
F Java Is Robust
جافا آمنة
F— Java Is Secure . املتطورةJava للتكيف مع بيئة أداءJava تم تصميم
جافا تكتب الرنامج مرة واحدة وتعيد استخدامة
F Java Is يمكن تحميل كود جديد على الطاير
F Java Is Architecture-Neutral . دون إعادة تجميعMultithreaded
جافا محملة مو محتاج احمل مترجم عشان تشتغل
F Java Is Portable
أداء جافا Java was designed to adapt to an evolving
F Java's Performance environment. New code can be loaded on the fly
جافا هو متعدد مؤشرات الترابط
without recompilation.
F Java Is Multithreaded
جافا ديناميكي
F Java Is Dynamic
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
60134 It Ilja's
JDK Versions
F JDK 1.02 (1995)
F .
F .
F .
F JDK 1.8 (2014) a. k. a. JDK 8 or Java 8
F .
F .
F JDK 15 September, 2020
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
5
JDK Editions
. لتطوير تطبيقات أو تطبيقات صغيرة مستقلة من جانب العميلJ2SE يمكن استخدام- (J2SE) جافا اإلصدار القياسي
ops
F Java Standard Edition (J2SE)
– J2SE can be used to develop client-side standalone
applications or applets.
of
F Java Enterprise Edition (J2EE)
– J2EE can be used to develop server-side applications
135 26
such as Java servlets, Java ServerPages, and Java
ServerFaces.
F Java Micro Edition (J2ME).
– J2ME can be used to develop applications for mobile
devices such as cell phones.
This book uses J2SE to introduce Java
programming.
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0
Popular Java IDEs
F NetBeans 910181 133
Java Enterprise Edition
F Eclipse (J2EE) يمكن استخدامJ2EE
لتطوير تطبيقات من جانب الخادم
مثلJava servlets و
JavaServerPages وJava
ServerFaces
I
98
Java Micro Edition
دعواتكم
عزيزه الطالب: أختكم
Liang, Introduction to Java Programming, Eleventh Edition, (c) 2018 Pearson Education, Ltd.
All rights reserved.
0