Chapter 1 Introduction to Computers and Java
Section 1.1 Introduction
1.1 Q1: Which of the following statements is false?
a.	Object-oriented programming is today's key programming methodology.
b.	Java has become the language of choice for implementing Internet-based applications and software for devices that communicate over a network.
c.	Software commands computer hardware to perform tasks.
d.	In use today are more than a trillion general-purpose computers and trillions more Java-enabled cellphones, smartphones and other handheld devices.
ANS: d. In use today are more than a trillion general-purpose computers and trillions more Java-enabled cellphones, smartphones and other handheld devices.

1.1 Q2: Which edition of Java is geared toward developing large-scale, distributed networking applications and web-based applications?
a.	Standard Edition.
b.	Industrial Edition.
c.	Enterprise Edition.
d.	Micro Edition.
ANS: c. Enterprise Edition.

Section 1.2 Hardware and Software

1.2 Q1: Which of the following statements is false?
a.	Computers can perform calculations and make logical decisions phenomenally faster than human beings can.
b.	Supercomputers are already performing thousands of trillions (quadrillions) of instructions per second. 
c.	Unfortunately, silicon is expensive, so it has made computing more costly.
d.	Computers process data under the control of sequences of instructions called computer programs.
ANS: c. Unfortunately, silicon is expensive, so it has made computing more costly. Actually, silicon is inexpensive –  it's an ingredient in common sand.
	
1.2 Q2. A computer consists of various devices referred to as ________ (e.g., the keyboard, screen, mouse, hard disks, memory, DVD drives and processing units). 
a. objects
b. software
c. hardware
d. groupware
ANS: c. hardware.

Section 1.2.1 Moore’s Law	
1.2.1 Q1: Which of the following is most closely associated with Moore's Law?
a.	Every year or two, the price of computers has approximately doubled.
b.	Object-oriented programming uses less memory than previous software-development methodologies.
c.	Demand for communications bandwidth is decreasing dramatically each year.
d.	Every year or two, the capacities of computers have approximately doubled without any increase in price.
ANS: d. Every year or two, the capacities of computers have approximately doubled without any increase in price.

Section 1.2.2 Computer Organization
1.2.2 Q1: Which of the following statements is false?
a.	A quadrillion-instruction-per-section computer can perform in one second more than 100,000 instructions for every person on the planet.
b.	Today's key programming methodology is object-oriented programming.
c.	The vast majority of the microprocessors produced each year are used in general-purpose computers.
d.	Computers process data under the control of sets of instructions called computer programs..
ANS: c. The vast majority of the microprocessors produced each year are used in general-purpose computers. Actually, they're used mostly in embedded systems.

1.2.2 Q2: Which of the following is not one of the six logical units of a computer?
a.	Input unit.
b.	Output unit.
c.	Central processing unit.
d.	Printer.
ANS: d. Printer.

1.2.2 Q3: Which of the following statements is false?
a.	Speaking to your computer is a form of input.
b.	Playing a video is an example of output.
c.	A multi-core processor implements several processors on a single integrated-circuit chip.
d.	Information in the memory unit is persistent—it is retained when the computer's power is turned off.
ANS: d. Information in the memory unit is persistent—it is retained when the computer's power is turned off. Actually the information is volatile—it's lost when power is turned off.

Section 1.3 Data Hierarchy
1.3	Q1: Which of the following statements is false?
a.	The impressive functions performed by computers involve only the simplest manipulations of 1s and 2s .	
b.	ASCII is a popular subset of Unicode.
c.	Fields are composed of characters or bytes.
d.	On some operating systems, a file is viewed simply as a sequence of bytes.
ANS: a. The impressive functions performed by computers involve only the simplest manipulations of 1s and 2s . It's 1s and 0s.	

1.3 Q2: Which of the following data items are arranged from the smallest to the largest in the data hierarchy.
a.	records, characters, fields, bits, files.
b.	bits, files, fields, records, characters.
c.	fields, characters, bits, files, records.
d.	bits, characters, fields, records, files.
ANS: d. bits, characters, fields, records, files.

Section 1.4 Machine Languages, Assembly Languages and High-Level Languages
1.4 Q1: Which of the following is not one of the three general types of computer languages?
a.	Machine languages.
b.	Assembly languages.
c.	High-Level languages.
d.	Spoken languages.
ANS: d. Spoken languages.

1.4 Q2: Which of the following statements is true?
a.	Interpreted programs run faster than compiled programs.
b.	Compilers translate high-level language programs into machine language programs.
c.	Interpreter programs typically use machine language as input.
d.	None of the above.
ANS: b. Compilers translate high-level language programs into machine language programs.

Section 1.5 Introduction to Object Technology
1.5 Q1:  ________ models software in terms similar to those that people use to describe real-world objects.
a.	Object-oriented programming
b.	Object-oriented design
c.	Procedural programming
d.	None of the above
ANS: b. Object-oriented design.

Section 1.5.1 The Automobile as an Object

(no questions)

Section 1.5.2 Methods and Classes

1.5.2 Q1: Which of the following statements is true?
a. Performing a task in a program requires a method. 
b. A method houses the program statements that actually perform its tasks. 
c. The method hides its statements from its user, just as the accelerator pedal of a car hides from the driver the mechanisms of making the car go faster. 
d All of the above. 
ANS: d. All of the above.

Section 1.5.3 Instantiation
1.5.3 Q1: Which statement is false?
a. Classes are reusable software components.
b. A class is to an object as a blueprint is to a house.
c. Performing a task in a program requires a method.
d. A class is an instance of its object.
ANS: d. A class is an instance of its object. The reverse is true.

Section 1.5.4 Reuse

1.5.4 Q1: Which of the following statements is false?
a. Each class can be used only once to build many objects. 
b. Reuse helps you build more reliable and effective systems, because existing classes and components often have undergone extensive testing, debugging and performance tuning. 
c. Just as the notion of interchangeable parts was crucial to the Industrial Revolution, reusable classes are crucial to the software revolution that has been spurred by object technology.
d. Avoid reinventing the wheel—use existing high-quality pieces wherever possible. This software reuse is a key benefit of object-oriented programming.
ANS: a. Each class can be used only once to build many objects  Actually, you can reuse a class many times to build many objects.

Section 1.5.5 Messages and Method Calls

1.5.5 Q1: Which of the following statements is true?
a. When you drive a car, pressing its gas pedal sends a message to the car to perform a task—that is, to go faster. 
b. You send messages to an object; each message is implemented as a method call that tells a method of the object to perform its task. 
c. A program might call a bank-account object’s deposit method to increase the account’s balance. 
d. All of the above statements are true.
ANS: d. All of the above statements are true.

Section 1.5.6 Attributes and Instance Variables

1.5.6 Q1: Which of the following statements is false?
a. An object's attributes are specified as part of the object’s class. 
b. A bank-account object would likely have a balance attribute that represents the amount of money in the account. c. Each bank-account object knows the balance in the account it represents, but not the balances of the other accounts in the bank. 
d. Attributes are specified by the class’s methods.
ANS: d. Attributes are specified by the class’s methods. Acually, attributes are specified by the class’s instance variables.

Section 1.5.7 Encapsulation and Information Hiding

1.5.7 Q1: Which of the following statements is false?
a. Classes (and their objects) encapsulate, i.e., encase, their attributes and methods. 
b. A class’s (and its object’s) attributes and methods are intimately related. 
c. For objects to communicate effectively with one another, each must know how the other object is implemented.
d.  Information hiding is crucial to good software engineering. 
ANS: c. For objects to communicate effectively with one another, each must know how the other object is implemented. Actually, Objects are normally not allowed to know how other objects are implemented—implementation details are hidden within the objects themselves.

Section 1.5.8 Inheritance

1.5.8 Q1: A new class of objects can be created conveniently by ________; the new class (called the ________) starts with the characteristics of an existing class (called the ________), possibly customizing them and adding unique characteristicsof its own. 
a. inheritance, superclass, subclass.
b. composition, subclass, superclass
c. inheritance, subclass, superclass
d. composition, superclass, subclass
ANS: c. inheritance, subclass, superclass

Section 1.5.9 Interfaces

1.5.9  Q1: Java supports ________; collections of related methods that typically enable you to tell objects what to do, but not how to do it (we’ll see an exception to this in Java SE 8).
a. classes
b. subclasses
c. superclasses
d. interfaces
ANS: d. interfaces  

Section 1.5.10 Object-Oriented Analysis and Design (OOAD)

1.5.10  Q1: To create the best solutions, you should follow a detailed ________  process for determining your project’s ________ (i.e., defining what the system is supposed to do) and developing a ________ that satisfies them (i.e., specifying how the system should do it).
a. design, requirements, analysis
b. analysis, requirements, design
c. requirements, design, analysis
d. analysis, design, set of requirements
ANS: b. analysis, requirements, design

Section 1.5.11 The UML (Unified Modeling Language)
1.5.11 Q1:  ________ is a graphical language that allows people who design software systems to use an industry standard notation to represent them.
a.	The Unified Graphical Laguage
b.	The Unified Design Language
c.	The Unified Modeling Language
d.	None of the above
ANS: c. The Unified Modeling Language.	

Section 1.6 Operating Systems
1.6 Q1: Which of the following statements is false?
a. Operating systems are software systems that make using computers more convenient for users, application developers and system administrators. 
b. Operating systems provide services that allow each application to execute safely, efficiently and concurrently (i.e., in parallel) with other applications. 
c. Popular desktop operating systems include Linux and Windows.
d. Popular mobile operating systems used in smartphones and/or tablets include Google’s Android, Apple’s iOS (for its iPhone, iPad and iPod Touch devices), Windows Phone 8 and Mac OS X.
ANS: d. Popular mobile operating systems used in smartphones and/or tablets include Google’s Android, Apple’s iOS (for its iPhone, iPad and iPod Touch devices), Windows Phone 8 and Mac OS X. Actually, Mac OS X is not a mobile operating system, it's a desktop operating system.

1.6 Q2: The software that contains the core components of the operating system is the ________. 
a. colonel.
b. central processing unit
c. core
d. kernel.
ANS: d. kernel.

Section 1.6.1 Windows—A Proprietary Operating System
1.6.1 Q1 Which of the following statements is false?
a. The concepts of icons, menus and windows were originally developed by Xerox PARC.
b. Windows is an open source operating system.
c. The software that contains the core components of the operating system is called the kernel.
d. Linux source code is available to the public for examination and modification.
Ans: b. Windows is an open source operating system. Actually, Windows is a proprietary operating system.

Section 1.6.2 Linux—An Open-Source Operating System
1.6.2 Q1: Which of the following is not a key organization in the open-source community?
a. Apache.
b. Mozilla.
c. Firefox.
d. Eclipse.
ANS: c. Firefox (it's a web browser made by the open source organization Mozilla).

Section 1.6.3 Apple’s macOS and Apple’s iOS for iPhone®, iPad® and iPod Touch® Devices
1.6.3 Q1: Which of the following statements is false?
a. Apple, founded in 1976 by Steve Jobs and Steve Wozniak, quickly became a leader in personal computing.
b. 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.
c. Apple’s macOS operating system is a descendant of Microsoft Windows.
d. 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.
ANS: c. Apple’s macOS operating system is a descendant of Microsoft Windows. Apple’s macOS operating system is a actually descendant of NeXT’s NeXTSTEP.

Section 1.6.4 Android

1.6.4 Q1: Which of the following statements is false?
a. Android—the fastest-growing mobile and smartphone operating system—is based on the Windows kernel and uses Java.
b. Android is open source and free.
c. Android smartphones include the functionality of a mobile phone, Internet client (for web browsing and Internet communication), MP3 player, gaming console, digital camera and more.
d. Android handheld devices feature full-color multitouch screens which allow you to control the device with gestures involving one touch or multiple simultaneous touches. 
ANS: a. Android—the fastest-growing mobile and smartphone operating system—is based on the Windows kernel and uses Java. Actually, Android is based on the Linux kernel.

Section 1.7 Programming Languages
1.7 Q1: Today, virtually all new major operating systems are written in:
a.	Objective-C.
b.	C or  C++.
c.	Visual C#.
d.	Ada.
ANS: b. C or C++.

1.7 Q2: Which of the following languages is used primarily for scientific and engineering applications?
a.	Fortran.
b.	COBOL.
c.	Pascal.
d.	Basic.
ANS: a. Fortran.

1.7 Q3: Which language was developed by Microsoft in the early 1990s to simplify the development of Windows applications?
a. Visual C#.
b. Python.
c. Objective-C.
d. Visual Basic.
ANS: d. Visual Basic.

Section 1.8 Java
1.8 Q1: Java was originally developed for:
a.	Operating systems development.
b.	Intelligent consumer devices.
c.	Personal computers.
d.	Distributed computing.
ANS: b. Intelligent consumer devices.

1.8 Q2: Which of the following statements about Java Class Libraries is false:
a.	Java class libraries consist of classes that consist of methods that perform tasks.
b.	Java class libraries are also known as Java APIs (Application Programming Interfaces).
c.	An advantage of using Java  class libraries is saving the effort of designing, developing and testing new classes.
d.	Java class libraries are not portable
ANS: d.  Java class libraries are not portable. (Java class libraries are portable.)

Section 1.9 A Typical Java Development Environment
1.9 Q1:  The .class extension on a file means that the file:
a.	Contains java source code
b.	Contains HTML
c.	is produced by the Java compiler (javac).
d.	None of the above.
ANS: c. Is produced by the Java compiler (javac).

1.9 Q2 :  The command ________ executes a Java application.
a.	run
b.	javac
c.	java
d.	None of the above
ANS: c. java.	

Section 1.10 Test-Driving a Java Application
1.10 Q1: Which of the following statements is false?
a. The command window in Windows is called a Command Prompt.
b. The command window in OS X is called a Terminal.
c. The command window in Linux is called the shell.
d. All of the above are true.
ANS: d. All of the above are true.

1.10 Q2: To change to the completed application’s directory, we opened a command window and used the ________ command to change to the directory (also called a folder) for the Painter application. 
a. chge
b. cdir
c. cd
d. changeDirectory
ANS: c. cd

1.10 Q3: To run the Painter application, we used the java command, followed by the name of the application’s ________ file. (in this case Painter). 
a. .java
b. .class
c. .exe
d. .obj
ANS: b. .class 
Section 1.11 Internet and World Wide Web
1.11 Q1: Which of the following statements is false?
a. The ARPANET is the precursor to today’s Internet.
b. Today’s fastest Internet speeds are on the order of trillionsof bits per second with quadrillion-bit-per-second speeds on the horizon.
c. Although the ARPANET enabled researchers to network their computers, its main benefit proved to be the capability for quick and easy communication via what came to be known as electronic mail (e-mail). 
d. The protocol (set of rules) for communicating over the ARPANET became known as the Transmission Control Protocol (TCP). TCP ensured that messages, consisting of sequentially numbered pieces called packets, were properly routed from sender to receiver, arrived intact and were assembled in the correct order.
ANS: b. Today’s fastest Internet speeds are on the order of trillions of bits per second with quadrillion-bit-per-second speeds on the horizon. Actually, today’s fastest Internet speeds are on the order of billions of bits per second with trillion-bit-per-second speeds on the horizon.

Section 1.11.1 The Internet: A Network of Networks

1.11.1 Q1: A huge variety of networking hardware and software appeared. One challenge was to enable these different networks to communicate with each other. ARPA accomplished this by developing the ________, which created a true “network of networks,” the current architecture of the Internet. 
a. Web Protocol (WP)
b. ARPA Protocol (AP)
c. Internet Protocol (IP)
d. Newrok Protocol (NP)
ANS: c. Internet Protocol (IP).
	
Section 1.11.2 The World Wide Web: Making the Internet User-Friendly
1.11.2 Q1: ________ is a communications protocol used to send information over the web. 
a.	HyperText Markup Language (HTML).
b.	URL (Uniform Resource Locator).
c.	Web 2.0
d.	TCP/IP
ANS: a. Hypertext Transfer Protocol (HTTP).

Section 1.11.3 Web Services and Mashups

1.11.3 Q1:  Which of the following statements is false?
a. The Ajax applications-development methodology enables you to rapidly develop powerful software applications by combining (often free) complementary web services and other forms of information feeds. 
b. One of the first mashups combined the real-estate listings provided by www.craigslist.org with the mapping capabilities of Google Maps to offer maps that showed the locations of homes for sale or rent in a given area.        
c. Twitter offers microblogging web services.
d. Foursquare offers mobile check-in web services.
ANS: a. The Ajax applications-development methodology enables you to rapidly develop powerful software applications by combining (often free) complementary web services and other forms of information feeds. Actually, it's the mashups applcations-development methodology.

Section 1.11.4 The Internet of Things

1.11.5 Q1: Which of the following statements is true?
a. The Internet is just a network of computers.
b. The internet is now an Internet of Things. 
c. Each thing in the Internet of things is an object with an IP address.
d. Each thing in the Internet of Things must have the ability to send data automatically over a network.
ANS: a. The Internet is just a network of computers. Actually, this is no longer true—the Internet of Things connects a wide array of devices that have IP addresses and can send data over the Internet.

Section 1.12 Software Technologies
1.12 Q1:  ________ involves reworking programs to make them clearer and easier to maintain while preserving their correctness and functionality.
a.	Object-oriented programming
b.	Refactoring
c.	Agile software development
d.	LAMP
ANS: b. Refactoring.

1.12 Q2: Which software product release category is "generally feature complete and supposedly bug free, and ready for use by the community?"
a. Alpha.
b. Beta.
c. Release candidate.
d. Continuous beta.
ANS: c. Release candidate.