Java How to Program, 9/e Presented by: José M. Reyes Álamo ©1992-2012 by Pearson Education, Inc. All Rights Reserved.

Slides:



Advertisements
Similar presentations
Introduction to Java and Java Applications Lecture Note -1
Advertisements

Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Object Orientated Programming
Introduction to Computers and Java Recitation - 01/11/2008 CS 180 Department of Computer Science, Purdue University.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Programming Our First Java Program Yingcai Xiao. What to Do Set up for Java Programming Write our first Java Program with IDE Write our first Java Program.
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Computers, Applications, and Java 1 Based on slides from Deitel & Associates, Inc. Modified and enhanced by T. A. Yang.
For more Lectures and Notes Visit
 2002 Prentice Hall. All rights reserved. Week 1 - Introduction to Object- Oriented Programming Outline 1.1 Machine Languages, Assembly Languages and.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Introduction to Java.
Java How to Program, 9/e Instructor: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
Java How to Program, 9/e © by Pearson Education, Inc. All Rights Reserved.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
Java™ How to Program, 9/e Presented by: Dr. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
COMP Computer Basics Yi Hong May 13, 2015.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a.
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Introduction to Java Tonga Institute of Higher Education.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Java How to Program, 9/e © by Pearson Education, Inc. All Rights Reserved.
 2005 Pearson Education, Inc. All rights reserved. 1 Introduction & The Java Virtual Machine Small Java Chapter 1 1.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
Java How to Program, 9/e © by Pearson Education, Inc. All Rights Reserved.
Object Oriented Programming Lecturer: Andreas P. Adi
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
 2003 Prentice Hall, Inc. All rights reserved. 1 Java Training Course Dr. H.E. Dunsmore Purdue University Java – How to Program, Deitel (5 th Edition)
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
 2005 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and the World Wide Web.
Computer Programming 12 Mr. Jean March 19 th, 2013.
1.  At the end of this slide, student can:  Explore tools, features, properties and interface of the Textpad.  Creating a new project.  Open and run.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Java How to Program, 9/e © by Pearson Education, Inc. All Rights Reserved.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
1 CSC204 – Programming I Lecture 2 Intro to OOP with Java.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
1 CS210 Intermediate Computing with Data Structures (Java) Saaid Baraty S-3-90.
CT1513 Introduction To java © A.AlOsaimi.
Java How to Program, 9/e © by Pearson Education, Inc. All Rights Reserved.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
1 Chapter 1 Java –Originally for intelligent consumer-electronic devices –Then used for creating Web pages with dynamic content –Now also used for: Develop.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Before You Begin Nahla Abuel-ola /WIT.
Introduction to Computers, the Internet and the World Wide Web
Chapter 1 Introduction to Computers, Programs, and Java
Lecture 1: Introduction to JAVA
Topic: Difference b/w JDK, JRE, JIT, JVM
Chapter 2 First Java Programs
Java programming lecture one
Introduction to Computer Programing and Java
Chapter 1 Introduction to Computers and Java
Computer Programming-1 CSC 111
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

Java How to Program, 9/e Presented by: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.

 Syllabus  Motivation for Java  Tools to be used: Blackboard, OpenLab, Eclipse © by Pearson Education, Inc. All Rights Reserved.

 Java is the world’s most widely used computer programming language.  You’ll learn to write instructions commanding computers to perform tasks.  You’ll learn object-oriented programming—today’s key programming methodology.  You’ll create and work with many software objects in this text.  You will learn data structures and the Java Application Programming Interface (API) © by Pearson Education, Inc. All Rights Reserved.

 Java is the preferred language for meeting many organizations’ enterprise programming needs.  Java has become the language of choice for implementing Internet-based applications and software for devices that communicate over a network.  In use today are more than a billion general-purpose computers and billions more Java-enabled cell phones, smartphones and handheld devices (such as tablet computers). © by Pearson Education, Inc. All Rights Reserved.

 Objects are essentially reusable software components. ◦ There are date objects, time objects, audio objects, video objects, automobile objects, people objects, etc. ◦ Software object have attributes (e.g., name, color and size) and behaviors (e.g., calculating, moving and communicating).  Using a modular, object-oriented design and implementation approach can make software- development groups much more productive than was possible with earlier popular techniques like “structured programming”  Object-oriented programs are often easier to understand, correct and modify. © by Pearson Education, Inc. All Rights Reserved.

 The Automobile as an Object ◦ Someone designed the car, built the car. ◦ You use the car (pedal, steering wheel) without the need to know the details how it works.  Smartphone ◦ Someone designed and built the phone ◦ You use the phone interface without the need to know the internal details how it works. © by Pearson Education, Inc. All Rights Reserved.

 Methods ◦ A set of statements that perform a particular task, similar to a function ◦ Implementation is hidden from its user  Attributes ◦ Attributes are specified as part of the object’s class, also known as instance variables.  Classes ◦ A set of methods and attributes to perform class related tasks. ◦ A class is similar in concept to a car/smartphone design.  Object ◦ An instance of a class. ◦ Instantiation means that the Operating System (OS) allocates resources such as memory and processor for class methods to execute. ◦ Just as someone has to build a car based on its design, you must build an object of a class before a program can execute the class’s methods. © by Pearson Education, Inc. All Rights Reserved.

 Reuse ◦ Just as a car’s engineering design can be reused many times to build many cars, you can reuse a class many times to build many objects. ◦ Reusing classes saves time and effort. ◦ Reuse also helps you build more reliable and effective systems, because existing classes and components often have gone through extensive testing, debugging and performance tuning. © by Pearson Education, Inc. All Rights Reserved.

 Messages and Methods Calls ◦ When you drive a car, pressing the gas pedal sends a message to the car (to go faster). ◦ Similarly, 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. © by Pearson Education, Inc. All Rights Reserved.

 Encapsulation ◦ Classes encapsulate (i.e. wrap) attributes and methods into objects—an object’s attributes and methods are intimately related. ◦ Objects may communicate with one another, but they’re normally not allowed to know how other objects are implemented—implementation details are hidden within the objects themselves. ◦ Information hiding, as we’ll see, is crucial to good software engineering. © by Pearson Education, Inc. All Rights Reserved.

 Inheritance ◦ A new class of objects can be created quickly and conveniently by inheritance—the new class absorbs the characteristics of an existing class, possibly customizing them and adding unique characteristics of its own. ◦ Using the car analogy, an object of class “convertible” certainly is an object of the more general class “automobile”. © by Pearson Education, Inc. All Rights Reserved.

 Polymorphism ◦ Enables you to “program in the general” rather than “program in the specific.” ◦ Polymorphism enables you to write objects that can take more than one form. ◦ Process different objects that share the same properties as if they’re all objects of the same class, simplifying programming. © Copyright by Pearson Education, Inc. All Rights Reserved.

 Java is the most widely used software development language in the world.  Java Class Libraries ◦ Rich collections of existing classes and methods ◦ Also known as the Java APIs (Application Programming Interfaces). © by Pearson Education, Inc. All Rights Reserved.

 Java programs normally go through five phases ◦ edit ◦ compile ◦ load ◦ verify ◦ execute © by Pearson Education, Inc. All Rights Reserved.

 Writing a Java program (The hard way!!!) ◦ Type a Java program (source code) using a text editor (Notepad in Windows; vi, emacs in Linux) ◦ Save the program with the.java extension  e.g. HelloWorld.java ◦ Compile the program using the java command  e.g. javac HelloWorld.java ◦ If no errors, run the compiled program without the extension  e.g. java HelloWorld © by Pearson Education, Inc. All Rights Reserved.

 Writing a Java program (The easy way!!!)  Use and Integrated Development Environment (IDE) ◦ Provide tools for software development process, including editors, debuggers, and compilers all together.  Popular IDEs ◦ ***Eclipse ( ) ◦ NetBeans ( ). © by Pearson Education, Inc. All Rights Reserved.

 Java compiler translates Java source code into bytecodes that represent the tasks to execute.  Bytecodes are executed by the Java Virtual Machine (JVM)—a part of the JDK and the foundation of the Java platform.  Virtual machine (VM)—a software application that simulates a computer ◦ Hides the underlying operating system and hardware from the programs that interact with it.  If the same VM is implemented on many computer platforms, applications that it executes can be used on all those platforms. © by Pearson Education, Inc. All Rights Reserved.

 Bytecodes are platform independent ◦ They do not depend on a particular hardware platform.  Bytecodes are portable ◦ The same bytecodes can execute on any platform containing a JVM that understands the version of Java in which the bytecodes were compiled.  The JVM is invoked by the java command. For example, to execute a Java application called Welcome, you’d type the command  java Welcome © by Pearson Education, Inc. All Rights Reserved.

 The JVM executes the program’s bytecodes.  JVMs typically execute bytecodes using a combination of interpretation and so-called just-in-time (JIT) compilation.  Analyzes the bytecodes as they’re interpreted  A just-in-time (JIT) compiler—known as the Java HotSpot compiler—translates the bytecodes into the underlying computer’s machine language. © by Pearson Education, Inc. All Rights Reserved.

 Blackboard will be used to take quizzes and submit assignments.  Grades will also be posted on Blackboard.  It is your responsibility to check Blackboard constantly. © by Pearson Education, Inc. All Rights Reserved.  OpenLab will be used to post you lab reports.  Class website is also hosted on the OpenLab.

© Copyright by Pearson Education, Inc. All Rights Reserved.  Create an OpenLab portfolio  Install Java  Creating a simple HelloWorld kind of program  Post it in your OpenLab portfolio Lab #1