0% found this document useful (0 votes)
9 views98 pages

JHTP11 01

The document introduces Java as a widely used programming language essential for software development, particularly in object-oriented programming and Internet-based applications. It discusses the various editions of Java, including Java Standard Edition, Java Enterprise Edition, and Java Micro Edition, each tailored for different application needs. Additionally, it covers the data hierarchy in computing, the role of operating systems, and the significant impact of Moore's Law on computer technology advancements.

Uploaded by

yc1528yc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views98 pages

JHTP11 01

The document introduces Java as a widely used programming language essential for software development, particularly in object-oriented programming and Internet-based applications. It discusses the various editions of Java, including Java Standard Edition, Java Enterprise Edition, and Java Micro Edition, each tailored for different application needs. Additionally, it covers the data hierarchy in computing, the role of operating systems, and the significant impact of Moore's Law on computer technology advancements.

Uploaded by

yc1528yc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 98

Chapter 1

Introduction to
Computers, the Internet and Java
Java How to Program, 11/e, Global Edition

https://www.youtube.com/watch?v=39ubNuxnrK8
1.1 Introduction
 Java is one of the world’s most widely used computer programming
languages.
 You’ll learn to write instructions ( 指令 ) in the Java programming

language
 commanding computers to perform tasks.
 Software (i.e., the instructions you write) controls hardware (i.e.,

computers).
 You’ll learn object-oriented programming—today’s key programming

methodology.
 You’ll create and work with many software objects.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 2


1.1 Introduction (Cont.)
 For many organizations, the preferred ( 偏好的 ) language for meeting their
enterprise programming needs is Java.
 Java is also widely used for implementing ( 實作 ) Internet-based applications and
software for devices that communicate over a network.
 There are billions of personal computers in use and an even larger number of
mobile devices with computers at their core
 According to Oracle’s 2016 JavaOne conference keynote presentation (
http://bit.ly/JavaOne2016Keynote), there are now 10 million Java developers
worldwide and Java runs on 15 billion devices (Fig. 1.1), including two billion
vehicles and 350 million medical devices.
 In addition, the explosive ( 爆炸性 ) growth of mobile phones, tablets and other
devices is creating significant ( 明顯的 ) opportunities for programming mobile
apps.
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 3
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 4
1.1 Introduction (Cont.)
Java Standard Edition ( 標準版 )
 Java How to Program, 10/e is based on Java Standard Edition 8 (Java SE

8) and Java Standard Edition 9 (Java SE 9)


 Java Standard Edition contains the capabilities needed to develop

desktop and server ( 伺服器 ) applications.


 Prior to Java SE 8, Java supported three programming paradigms ( 模式 )

◦ Procedural programming ( 程序程式設計 )


◦ Object-oriented programming ( 物件導向程式設計 )
◦ Generic programming ( 泛形程式設計 )
 Java SE 8 added the beginnings of functional programming ( 函數程式設計 )
with lambdas and streams
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 5
1.1 Introduction (Cont.)
Java Enterprise Edition ( 企業版 )
 Java is used in such a broad spectrum of applications that it has two

other editions.
 The Java Enterprise Edition (Java EE) is geared toward developing

large-scale, distributed networking applications and web-based


applications.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 6


1.1 Introduction (Cont.)
 Java Micro Edition (Java ME) ( 微型版 )
◦ Subset of Java SE.
◦ Geared toward developing applications for resource-constrained embedded
devices, such as
 Smartwatches
 MP3 players
 television set-top boxes
 smart meters (for monitoring electric energy usage)
 and more.
◦ Many of the devices in use Java ME.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 7


1.2 Hardware and Software
 Computers can perform calculations and make logical decisions
phenomenally faster than human beings can.
 Today’s personal computers can perform billions of calculations in
one second—more than a human can perform in a lifetime.
 Supercomputers are already performing thousands of trillions
(quadrillions) of instructions per second!

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 8


https://www.top500.org/

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 9


https://en.wikipedia.org/wiki/TOP500

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 10


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 11
1.2 Computers: Hardware and Software (Cont.)
 Computers process data under the control of sequences of
instructions called computer programs.
 These software programs guide the computer through ordered
actions specified by people called computer programmers ( 程式設計
師).
 You’ll learn a key programming methodology ( 方法 ) that’s enhancing
programmer productivity, thereby reducing software development
costs—object-oriented programming.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 12


1.2 Computers: Hardware and Software (Cont.)
 A computer consists of various devices referred to as hardware
◦ (e.g., the keyboard, screen, mouse, hard disks, memory, DVD drives and
processing units).
 Computing costs are dropping dramatically ( 戲劇性的 ), owing to rapid
developments in hardware and software technologies.
 Computers that might have filled large rooms and cost millions of dollars
decades ago are now inscribed on silicon chips smaller than a fingernail,
costing perhaps a few dollars each.
 Silicon-chip ( 矽晶片 ) technology has made computing so economical that
computers have become a commodity.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 13


1.2 .1 Moore’s Law ( 摩爾定律 )
 Every year or two, the capacities of computers have approximately
doubled inexpensively.
 This remarkable trend often is called Moore’s Law.
 Named for the person who identified the trend, Gordon Moore, co-
founder of Intel.
 Moore’s Law and related observations apply especially to the amount
of memory that computers have for programs, the amount of secondary
storage (such as solid-state drive storage) they have to hold programs
and data over longer periods of time, and their processor speeds—the
speeds at which they execute their programs (i.e., do their work).

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 14


Moore’s Law ( 摩爾定律 )
Electronics Magazine 雜誌在 1965 年 4 月 19 日發表戈登摩爾撰寫的一篇專文,他在文中歸納預測 積體電路的複雜度每年會增加一倍,
且成本將持續下降。這項被稱為摩爾定律的預測促使科技普遍推廣至世界每個角落,如今更成為科技快速變遷的代名詞。摩爾在 1975 年修正他的預測,
預估晶片內部電晶體的數量每兩年會增加一倍,其效力一直延續今。 除了預測晶片複雜度的成長速度外 ( 以電腦晶片內含電晶體為基準 ) ,摩爾定律亦預
估成本 將持續下降。

就摩爾定律延伸, IC 技術每隔一年半推進一個世代。因為建造研究和實驗室的成本需求十分高 , 而有財力投資建立和維護晶片工廠的企業有限,研究原預測“摩爾定律“的時代快


將結束,但是”黃氏定律”似乎成功接手… Copyright © 2020 Pearson Education Ltd. All Rights Reserved 15
1.2 .1 Moore’s Law (Cont.)
 Similar growth has occurred in the communications field.
 Costs have plummeted as enormous demand for communications

bandwidth (i.e., information-carrying capacity) has attracted intense


competition.
 Such phenomenal improvement is fostering ( 促成 ) the Information

Revolution ( 資訊革命 ) .

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 16


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 17
1.2.2 Computer Organization
 Computers can be envisioned as divided into various logical units or
sections.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 18


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 19
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 20
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 21
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 22
https://www.youtube.com/watch?v=-P28LKWTzrI

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 23


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 24
https://www.youtube.com/watch?v=i-wpzS9ZsCs

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 25


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 26
1.3 Data Hierarchy ( 資料的層級 )
 Data items processed by computers form a data hierarchy that
becomes larger and more complex in structure as we progress from the
simplest data items (called “bits”) to richer ones, such as characters
and fields.

數位化

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 27


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 28
1.3 Data Hierarchy (Cont.)
Bits ( 位元 )
 The smallest data item in a computer can assume the value 0 or the value 1.
 Such a data item is called a bit (short for “binary digit”—a digit that can
assume either of two values).
 Remarkably, the impressive functions performed by computers involve only
the simplest manipulations of 0s and 1s—examining a bit’s value, setting a
bit’s value and reversing a bit’s value (from 1 to 0 or from 0 to 1).

Bytes ( 位元組 )

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 29


1.3 Data Hierarchy (Cont.)
Characters
 We prefer to work with decimal digits (0–9), uppercase letters (A–Z),
lowercase letters (a–z), and special symbols (e.g., $, @, %, &, *, (, ), –, +, ", :, ?
and / ).
 Digits, letters and special symbols are known as characters. The computer’s
character set is the set of all the characters used to write programs and
represent data items on that device.
 Computers process only 1s and 0s, so every character is represented as a
pattern of 1s and 0s.
 Java uses Unicode® characters that are composed of one, two or four bytes
(8, 16 or 32 bits).

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 30


1.3 Data Hierarchy (Cont.)
 Unicode contains characters for many of the world’s languages.
 See Appendix B for more information on the ASCII (American Standard Code
for Information Interchange) character set—the popular subset of Unicode
that represents uppercase and lowercase letters in the English alphabet,
digits and some common special characters.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 31


1.3 Data Hierarchy (Cont.)
Fields ( 欄位 )
 Just as characters are composed of bits, fields are composed of characters or
bytes.
 A field is a group of characters or bytes that conveys meaning.
 For example, a field consisting of uppercase and lowercase letters could be
used to represent a person’s name, and a field consisting of decimal digits
could represent a person’s age.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 32


1.3 Data Hierarchy (Cont.)
Records ( 紀錄 )
 Several related fields can be used to compose a record (implemented as a
class in Java).
 In a payroll system, for example, the record for an employee might consist of
the following fields (possible types for these fields are shown in
parentheses):
◦ Employee identification number (a whole number)
◦ Name (a string of characters)
◦ Address (a string of characters)
◦ Hourly pay rate (a number with a decimal point)
◦ Year-to-date earnings (a number with a decimal point)
◦ Amount of taxes withheld (a number with a decimal point)
 Thus, a record is a group of related fields.
 In the preceding example, all the fields belong to the same employee.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 33


1.3 Data Hierarchy (Cont.)
Files ( 檔案 )
 A file is a group of related records.
 More generally, a file contains arbitrary data in arbitrary formats.
 In some operating systems, a file is viewed simply as a sequence of bytes—
any organization of the bytes in a file, such as organizing the data into
records, is a view created by the application programmer.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 34


1.3 Data Hierarchy (Cont.)
Database ( 資料庫 )
 A database is a collection of data that’s organized for easy access and
manipulation.
 The most popular database model is the relational database in which data is
stored in simple tables.
 A table includes records and fields.
◦ For example, a table of students might include first name, last name, major, year, student
ID number and grade point average fields.
◦ The data for each student is a record, and the individual pieces of information in each
record are the fields.
 You can search, sort and otherwise manipulate the data based on its
relationship to multiple tables or databases.

Data warehouse( 資料倉儲 )

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 35


1.3 Data Hierarchy (Cont.)
Big Data ( 大數據 )
 The amount of data being produced worldwide is enormous and
growing explosively.
 According to IBM, approximately 2.5 quintillion bytes (2.5 exabytes)
of data are created daily
 According to Salesforce.com, as of October 2015 90% of the world’s
data was created in just the prior 12 months
 Big data applications deal with such massive amounts of data and
this field is growing quickly, creating lots of opportunity for software
developers.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 36


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 37
1.5.11 The UML (Unified Modeling Language)
 The Unified Modeling Language (UML) is the most widely used
graphical scheme for modeling object-oriented systems.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 38


1.6 Operating Systems ( 作業系統 )
 Software systems that make using computers more convenient.
 Provide services that allow each application to execute safely, efficiently and
concurrently ( 同步的, i.e., in parallel) with other applications.
 The software that contains the core ( 核 心 ) components of the operating system is
called the kernel.
 Popular desktop operating systems include Linux, Windows 10 and Mac OS X.
 Popular mobile operating systems used in smartphones and tablets include Google’s
Android, Apple’s iOS (for its iPhone, iPad and iPod Touch devices), Windows
Phone and Blackberry OS.
集中式批次處理、 multiprogramming 作業系統

1969 1971

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 39


1.6 Operating Systems
 Personal computing ( 個人電腦 )
◦ 1970 年代研發出矽晶片 (silicon chip) 技術,使電腦能夠更「小」與更「經濟」
◦ Computers for personal use
◦ 1977 年 Apple II 開始將個人電腦普及化
◦ 1981 年 IBM 將個人電腦導引應用到一般企業、工業、與政府
 分散式資料處理 (Distributed computing)
◦ 電腦經網路連結在一起
◦ 運算分散至多台電腦進行
 主從式運算 (Client/server computing)
◦ 伺服器 (Servers) 儲存共同使用的程式 (programs) 和資料 (data)
◦ 客戶端 (Clients) 從伺服器使用程式和資料

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 40


二 層 式 主 從 架 構 :

三層式主從架構:

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 41


區域網路 LAN
LAN (local area network) Internet

AP 伺服器 DB 伺服器

n 階式主從運算
會計
教務選課

Internet
總務
DB 伺服器
網頁伺服器
Web Server AP 伺服器

42
Copyright © 2020 Pearson Education Ltd. All Rights Reserved
雲端運算 http://en.wikipedia.org/wiki/Cloud_computing

雲端運算是一種以網際網路為基礎的資料處理,藉網際網路上共享的資源、軟體、 與資訊取得所需求的資料。

©1992-2015 by Pearson Education, Inc.


Copyright © 2020 Pearson Education Ltd. All Rights Reserved All Rights Reserved. 43
雲端計算不僅是技術問題,更是一種「商業模式」與「管理模式」的創新。

資料來源: 胡興耀 (2011) ,企業雲計算之未來趨勢及鼎捷如何佈局雲計算


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 44
SaaS, PaaS, & IaaS

「雲端應用服務」或稱「軟體即服務」 (SaaS) 係將軟體經由網際網路以服務型式提供給使用者,讓使用者不需在個人電腦安裝


軟體及執行,簡化了維護與支援作業。

「雲端平台服務」或稱「平台即服務」 (PaaS) 係將電腦平台及 / 或軟體以服務型式提供給使用者,讓使用者藉雲端設備使用雲端


應用程式。 PaaS 省去購買和管理軟硬體的複雜度與成本,協助應用程式的部署。

「雲端基礎設施服務」或稱「基礎設施即服務」 (IaaS) 係將電腦基礎設施及儲存空間與網路以服務型式提供給使用者,達成平台


環境虛擬化,亦即讓使用者將伺服器、軟體、資料儲存中心或網路完全「委外」而不需自行購置。 IaaS 提供者根據設施的使用量
收取服務費用。設施資源的耗用量或所付服務費用通常反應了使用活動的多寡。

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 45


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 46
運算方式正在轉型為「 GPU 加速和生成式 AI 運算」
https://www.google.com/search?
q=nvidea+Taipei+computex+keyno
te&sca_esv=563084529&ei=voj4Z
KGuFJDs2roPi_-
hsA8&ved=0ahUKEwihhamklZaB
AxUQtlYBHYt_CPYQ4dUDCA8&u
act=5&oq=nvidea+Taipei+compute
x+keynote&gs_lp=Egxnd3Mtd2l6L
XNlcnAiHm52aWRlYSBUYWlwZ
WkgY29tcHV0ZXgga2V5bm90ZTI
FEAAYogQyBRAAGKIEMgUQABii
BEi3swFQ1QtY_5cBcAd4AZABAJ
gBdaAB9gSqAQM3LjG4AQPIAQ
D4AQHCAgoQABhHGNYEGLAD
wgIIEAAYCBgeGA3iAwQYACBB4
gMFEgExIECIBgGQBgo&sclient=
gws-wiz-
serp#fpstate=ive&vld=cid:a44f3e2
1,vid:i-wpzS9ZsCs

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 47


1.6.1 Windows—A Proprietary ( 私有的 ) Operating System
 Mid-1980s: Microsoft developed the Windows operating system,
consisting of a graphical user interface built on top of DOS—an
enormously popular personal-computer operating system that users
interacted with by typing commands.
 Windows borrowed from many concepts (such as icons, menus and

windows) developed by Xerox PARC and popularized by early Apple


Macintosh operating systems.

Apple Apple II IBM PC DOS Apple Mackintosh Microsoft Windows Linux

Android Apple iOS

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 48


1.6.1 Windows—A Proprietary Operating System (Cont.)
 Windows 11 is Microsoft’s latest operating system
 Features include enhancements to the Start menu and user interface,

Cortana personal assistant for voice interactions, Action Center for


receiving notifications, Microsoft’s new Edge web browser, and more
 Windows is a proprietary operating system—it’s controlled by

Microsoft exclusively.
 Windows is by far the world’s most widely used operating system.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 49


1.6.2 Linux—An Open Source Operating System
 The Linux operating system is perhaps the greatest success of the
open-source movement
 Open-source software ( 開源軟體 ) departs from the proprietary

software development style that dominated software’s early years


 With open-source development, individuals and companies

contribute their efforts in developing, maintaining and evolving


software in exchange for the right to use that software for their own
purposes, typically at no charge

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 50


1.6.2 Linux—An Open Source Operating System (cont.)
 Open-source code is often scrutinized ( 審查 ) by a much larger
audience than proprietary software, so errors often get removed
faster
 Open source also encourages innovation. Enterprise systems

companies, such as IBM, Oracle and many others, have made


significant investments in Linux open-source development

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 51


1.6.2 Linux—An Open Source Operating System (cont.)
 Some key organizations in the open-source community are
 the Eclipse Foundation (the Eclipse Integrated Development Environment
helps programmers conveniently develop software)
 the Mozilla Foundation (creators of the Firefox web browser)
 the Apache Software Foundation (creators of the Apache web server used to
develop web-based applications)
 GitHub (which provides tools for managing open-source projects—it has
millions of them under development).

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 52


1.6.2 Linux—An Open Source Operating System (cont.)
 Rapid improvements to computing and communications, decreasing
costs and open-source software have made it much easier and more
economical to create a software-based business now than just a
decade ago
 A great example is Facebook, which was launched from a college

dorm room and built with open-source software

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 53


1.6.2 Linux—An Open Source Operating System (cont.)
 The Linux kernel is the core of the most popular open-source, freely
distributed, full-featured operating system
 Developed by a loosely ( 鬆散的 ) organized team of volunteers and is

popular in servers, personal computers and embedded systems


(such as the computer systems at the heart of smartphones, smart
TVs and automobile systems)

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 54


1.6.2 Linux—An Open Source Operating System (cont.)
 Linux source code (the program code) is available to the public for
examination and modification and is free to download and install
 Linux users benefit from a huge community of developers actively

debugging and improving the kernel, and the ability to customize the
operating system to meet specific needs.
 Linux has become extremely popular on servers and in embedded

systems, such as Google’s Android-based smartphones.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 55


1.6.3 Apple’s macOS and Apple’s iOS for iPhone®, iPad®
and iPod Touch® Devices
 Apple, founded in 1976 by Steve Jobs and Steve Wozniak, quickly
became a leader in personal computing
 In 1979, Jobs and several Apple employees visited Xerox PARC (Palo

Alto Research Center) to learn about Xerox’s desktop computer that


featured a graphical user interface (GUI)
 That GUI served as the inspiration for the Apple Macintosh, launched

with much fanfare in a memorable Super Bowl ad in 1984

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 56


1.6.3 Apple’s macOS and Apple’s iOS for iPhone®, iPad®
and iPod Touch® Devices (cont.)
 The Objective-C programming language, created by Brad Cox and Tom
Love at Stepstone in the early 1980s, added capabilities for object-
oriented programming (OOP) to the C programming language
 Steve Jobs left Apple in 1985 and founded NeXT Inc.
 In 1988, NeXT licensed Objective-C from StepStone and developed an

Objective-C compiler and libraries which were used as the platform for
the NeXTSTEP operating system’s user interface, and Interface Builder
—used to construct graphical user interfaces

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 57


1.6.3 Apple’s macOS and Apple’s iOS for iPhone®, iPad®
and iPod Touch® Devices (cont.)
 Jobs returned to Apple in 1996 when Apple bought NeXT.
 Apple’s macOS operating system is a descendant of NeXTSTEP.
 Apple’s proprietary operating system, iOS, is derived from Apple’s

macOS and is used in the iPhone, iPad, iPod Touch, Apple Watch and
Apple TV devices.
 In 2014, Apple introduced its new Swift programming language, which

became open source in 2015.


 The iOS app-development community is shifting from Objective-C to

Swift.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 58


1.6.4 Google's Android
 Android—the fastest growing mobile and smartphone operating
system—is based on the Linux kernel and Java.
 One benefit of developing Android apps is the openness of the platform

—the operating system is open source and free.


 The Android operating system was developed by Android, Inc., which

was acquired by Google in 2005.


 In 2007, the Open Handset Alliance was formed to develop, maintain

and evolve Android, driving innovation in mobile technology and


improving the user experience while reducing costs

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 59


1.6.4 Google's Android (cont.)
 According to Statista.com, as of Q3 2016, Android had 87.8% of the
global smartphone market share, compared to 11.5% for Apple
 Android is used in smartphones, e-reader devices, tablets, in-store

touch-screen kiosks ( 資訊機 ), cars, robots, multimedia players and more.


 We present an introduction to Android app development in our

textbook, Android How to Program, Third Edition, and in our


professional book, Android 6 for Programmers: An App-Driven
Approach, Third Edition.
 After you learn Java, you’ll find it realtively straightforward to begin

developing and running Android apps.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 60


1.4 Machine Languages, Assembly Languages and High-Level Languages

 Programmers write instructions in various programming languages,


some directly understandable by computers and others requiring
intermediate translation steps.
 These may be divided into three general types:

◦ Machine languages
◦ Assembly languages
◦ High-level languages

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 61


1.4 Machine Languages, Assembly Languages and High-Level Languages
(Cont.)
Machine Languages
 Any computer can directly understand only its own machine language, defined by its
hardware design.
◦ Generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct
computers to perform their most elementary operations one at a time.
◦ Machine dependent—a particular machine language can be used on only one type of computer.
Assembly Languages and Assemblers
 English-like abbreviations that represent elementary operations formed the basis
of assembly languages.
 Translator programs called assemblers ( 組譯器 ) convert early assembly-language
programs to machine language.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 62


1.4 Machine Languages, Assembly Languages and High-Level Languages
(Cont.)
High-Level Languages and Compilers
 High-level languages
◦ Single statements accomplish substantial tasks.
◦ Compilers convert high-level language programs into machine language.
◦ Allow you to write instructions that look almost like everyday English and contain commonly
used mathematical notations.
◦ A payroll program written in a high-level language might contain a single statement such as
 grossPay = basePay + overTimePay
Interpreters ( 直譯器 )
 Compiling a high-level language program into machine language can take
considerable computer time.
 Interpreter programs, developer to execute high-level language programs
directly, avoid the delay or compilation, although they run slower than compiled
programs.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 63


1.7 Programming Languages
 Figure 1.6 provides brief comments on several popular programming
languages. In the next section, we introduce Java.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 64


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 65
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 66
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 67
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 68
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 69
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 70
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 71
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 72
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 73
1.11 Internet and the World Wide Web
• Internet 前身係在 1960 年代後期,由 美國國防部 (DOD) 資助的 ARPA (Advanced Research Projects
Agency) 開發,原用以連結少數大學與研究機構的電腦,稱為 ARPAnet ,預防通訊在冷戰被破壞
• ARPAnet 快速簡易的通訊即是現今使用的電子信件 (electronic mail , e-mail)
• ARPAnet 的 通 訊 協 定 (protocol , set of rules) 即 是 TCP ( Transmission Control
Protocol) , TCP 確保訊息封包 (packets) 能從發送端正確 ( 接力 ) 傳送到接收端
• In parallel with the early evolution of the Internet, organizations worldwide were
implementing their own networks for both intraorganization (within an organization) and
interorganization (between organizations) communication.
• ARPA 開發了網際網路通訊協定 (Internet Protocol , IP) 克服不同網路間的通訊,建構了網路的網路 (a network of
networks)
• TCP/IP 是一複合通訊協定組
• Each Internet-connected- device has an IP address—a unique numerical identifier
used by devices communicating via TCP/IP to locate one another on the Internet.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 74


1.11 Internet and the World Wide Web (Cont.)
歐洲核子研究組織
 1989 年 , Tim Berners-Lee 在 CERN 開 發 了 經 由 超 文 字 標 籤 語 言 (HyperText Markup
Language HTML) 分享資訊,他也設計 HyperText Transfer Protocol (HTTP), 是網際網路的
主要通訊協定。
 Berners-Lee 在 1994 成立 World Wide Web Consortium ( 組織 ) (W3C) ,致力發展
World Wide Web 技術, The World Wide Web is a collection of hardware and
software associated with the Internet that allows computer users to locate and
view documents with various combinations of text, graphics, animations, audios
and videos on almost any subject.
 W3C 目標在連結全球性網頁,不分語言與文化
 World Wide Web (WWW 全球資訊網 )
◦ 用以搜尋與檢視多媒體 (multimedia) 文件
◦ 過去,大部分的應用程式都在未彼此連接的電腦上執行,今天的應用程式可以連結到全世界的電腦
 HTML 因標籤的限制,因此 W3C 繼續制定了 XML
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 75
1.11 Internet and the World Wide Web (Cont.)
• XML 可彈性自訂各種資料,是其最重要的特色
– 任何應用程式都能處理 XML 所描述的資料
– 軟體開發者逐漸將 XML 與其應用程式結合以改善其網頁功能與資料的交換性
– XML 亦被應用在資料庫 (database)
• 使用 XML 文件的應用程式彼此可以溝通,如果它們都能了解共同的 XML 字彙
• 簡易物件通訊協定 ( Simple Object Access Protocol , SOAP) 是一種以 XML 與 HTTP 為基礎的
通訊協定,多用於實作網路服務 (web service) 。 SOAP 以 XML 為訊息的「格式」,而以 HTTP 或
SMTP(Simple Mail Transfer Protocol ,簡易郵件傳送協定 ) 為訊息的「傳送協定」。 SOAP 的作用是
傳送編譯網路服務所需的「要求」給應用程式,再將應用程式處理後的結果送回,亦即是應用程式和使用者之間傳輸資料的一種機
制,可以在不同的作業系統與網路獨立運作。

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 76


1.11.1 Internet: A Network of Networks
 In parallel with the early evolution of the Internet, organizations
worldwide were implementing their own networks for both
intraorganization (that is, within an organization) and
interorganization (that is, between organizations) communication.
 One challenge was to enable these different networks to communicate
with each other.
 The Internet Protocol (IP) created a true “network of networks,” the
current architecture of the Internet.
 The combined set of protocols is now called TCP/IP.
 Each Internet-connected- device has an IP address—a unique
numerical identifier used by devices communicating via TCP/IP to
locate one another on the Internet.
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 77
1.11.1 The Internet: A Network of Networks (Cont.)
 Businesses rapidly realized that by using the Internet, they could
improve their operations and offer new and better services to their
clients.
 This generated fierce ( 殘忍的 ) competition among communications

carriers and hardware and software suppliers to meet the increased


infrastructure( 基礎設施 ) demand.
 As a result, bandwidth ( 頻寬 ) —the information-carrying capacity of

communications lines—on the Internet has increased tremendously,


while hardware costs have plummeted.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 78


1.11.2 Web 2.0: Going Social
 The web exploded in the mid-to-late 1990s, but the “dot com” economic bust
brought hard times in the early 2000s.
 Resurgence that began in 2004 or so has been named Web 2.0.
 Google is widely regarded as the signature company of Web 2.0.
 Some other companies with “Web 2.0 characteristics” are YouTube (video
sharing), FaceBook (social networking), Twitter (microblogging), Groupon (social
commerce), Foursquare (mobile check-in), Salesforce (business software offered
as online services), Craigslist (free classified listings), Flickr (photo sharing),
Second Life (a virtual world), Skype (Internet telephony) and Wikipedia (a free
online encyclopedia).

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 79


1.11.2 Web 2.0: Going Social (Cont.)
 Google
◦ In 1996, Stanford computer science Ph.D. candidates Larry Page and Sergey Brin began
collaborating on a new search engine.
◦ In 1997, they changed the name to Google—a play on the mathematical term googol
◦ Google’s ability to return extremely accurate search results quickly helped it become the most
widely used search engine and one of the most popular websites in the world.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 80


1.11.3 Web Services and Mashups ( 混搭 )
 Web Services and Mashups ( 混搭 )
Mashup is an applications-development methodology in which you can
rapidly develop powerful and intriguing ( 有 吸 引 力 的 ) applications by
combining (often free) complementary web services and other forms of
information feeds.
 A mashup is an applications-development methodology in which you

can rapidly develop powerful software applications by combining


(often free) complementary web services and other forms of
information feeds.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 81


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 82
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 83
1.11.4 Internet of Things ( 物聯網 ) Internet 互聯網
 The Internet is no longer just a network of computers—it’s an Internet of Things (IoT)
 A thing is any object with an IP address and the ability to send data automatically over the
Internet:
 a car with a transponder for paying tolls,
 monitors for parking-space availability in a garage,
 a heart monitor implanted in a human,
 monitors for drinkable water quality,
 a smart meter that reports energy usage,
 radiation detectors,
 item trackers in a warehouse,
 mobile apps that can track your movement and location,
 smart thermostats that adjust room temperatures based on weather forecasts and activity in the
home
 intelligent home appliances
 and many more.

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 84


1.11.4 Internet of Things (cont.)

At the convention on 6 February about “Companies, Consumers, Citizens: the


Internet of Things is growing” the results of research into the new and vast world
of the Internet of Things or Intelligent Objects, or Connected or Interconnected, or
the possibility of communicating machine-to-machine (M2M) and the resulting
potential offering of new services for the consumer/citizen were presented.
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 85
1.11.4 Internet of Things (cont.)

http://www.satiztpm.it/internet-things/?lang=en
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 86
1.11.4 Internet of Things (cont.)

Big Data
巨量數據

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 87


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 88
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 89
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 90
1.12 Software Technologies

敏捷軟體開發

重構

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 91


設計標準類型

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 92


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 93
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 94
Copyright © 2020 Pearson Education Ltd. All Rights Reserved 95
1.13 Keeping Up-to-Date with Information Technologies

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 96


Copyright © 2020 Pearson Education Ltd. All Rights Reserved 97
1.14 Getting Your Questions Answered
 There are many online forums in which you can get your Java
questions answered and interact with other Java programmers.
 Some popular Java and general programming forums include:

 StackOverflow.com
 Coderanch.com
 The Oracle Java
Forum—https://community.oracle.com/community/java
 </dream.in.code>—http://www.dreamincode.net/forums/
forum/32-java/

Copyright © 2020 Pearson Education Ltd. All Rights Reserved 98

You might also like