Chapter 1:
Introduction to Computers and Java
Starting Out with Java:
From Control Structures through
Data Structures
Second Edition by Tony Gaddis and Godfrey
Muganda
Chapter Topics
Chapter 1 discusses the following main topics:
– Introduction
– Why Program?
– Computer Systems: Hardware and Software
– Programming Languages
– What Is a Program Made Of?
– The Programming Process
– Object-Oriented Programming
© 2012 Pearson Education, Inc. All rights reserved.
1-2
Java History
• 1991 - Green Team started by Sun
Microsystems.
• *7 Handheld controller for multiple entertainment systems.
• There was a need for a programming language that would run on various devices.
• Java (first named Oak) was developed for this purpose. © 2012 Pearson Education, Inc. All rights reserved.
1-3
Introduction
• Java enabled web browser (HotJava) demonstrated at 1995 Sun World conference.
• Java incorporated into Netscape shortly after.
• Java is “cross platform”, meaning that it can run on various computer operating systems.
© 2012 Pearson Education, Inc. All rights reserved.
1-4
Java Applications and Applets
• Java programs can be of two types:
– Applications
• Stand-alone programs that run without the aid of a web browser. • Relaxed security model since the user runs the program locally. – Applets
• Small applications that require the use of a Java enabled web browser to run.
• Enhanced security model since the user merely goes to a web page and the applet runs itself.
© 2012 Pearson Education, Inc. All rights reserved.
1-5
Why Program?
• Computers are tools that can be programmed to perform many functions, such as:
• spreadsheets
• games
• databases
• etc.
• word processing
• Computers are versatile because they can be programmed. • Computer Programmers implement programs that perform these functions.
© 2012 Pearson Education, Inc. All rights reserved.
1-6
Why Program?
Aspects of a computer program that must be