13 X 11 Java Lecture 1 CS 1311 Introduction 13 X 11.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Designing a Program & the Java Programming Language
A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
CSE 105 Structured Programming Language (C)
Programming for Beginners
compilers and interpreters
13 X 11 Java Lecture 3 CS 1311 Structure 13 X 11.
In Review JAVA C++ GUIs - Windows Webopedia.com.
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Object Oriented Programming in Java George Mason University Fall 2011
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
Lecture 1: An Introduction to Java. What is Java? Programming language developed by Sun Microsystems in 1995 –Inherits its syntax from c –Adapted the.
©2004 Brooks/Cole Chapter 1: Getting Started Sections Covered: 1.1Introduction to Programming 1.2Constructing a Java Program 1.3The print() and println()
1 Programming & Programming Languages Overview l Machine operations and machine language. l Example of machine language. l Different types of processor.
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
1 Programming & Programming Languages Overview l Machine operations and machine language. l Example of machine language. l Different types of processor.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Getting Started with Java
IB Computer Science II Paul Bui
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
 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.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
BIT 1003 – Presentation 7. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
Introduction to Computers and Java Chapter 1.3. A Sip of Java: Outline History of the Java Language Applets A First Java Program Compiling a Java Program.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
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.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Programming Concept Chapter I Introduction to Java Programming.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Compiling and the Java Virtual Machine (JVM). The syntax of Pseudocode is pretty loose –visual validation encourages a permissive approach –emphasized.
2-1 Hardware CPU Memory - 2 kinds Network Graphics Input and Output Devices.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Lecture 8 February 29, Topics Questions about Exercise 4, due Thursday? Object Based Programming (Chapter 8) –Basic Principles –Methods –Fields.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
Java Basics 1 Brief History of Java and Overview of Langauge.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
CS-303 Introduction to Programming
CS 106 Introduction to Computer Science I 01 / 22 / 2007 Instructor: Michael Eckmann.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Introduction to OOP CPS235: Introduction.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Chapter 1 Object Orientation: Objects and Classes.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely.
Applications Active Web Documents Active Web Documents.
Programming paradigms
Visit for more Learning Resources
Concepts of Object Oriented Programming
Chapter 1 – Introduction to Computers, the Internet, and the Web
CSCI-235 Micro-Computer Applications
Key Ideas from day 1 slides
Lecture 1: Introduction to JAVA
High Level Programming Languages
Road to Object Oriented Programming
Presentation transcript:

13 X 11 Java Lecture 1 CS 1311 Introduction 13 X 11

Serious Stuff

13 X 11 Put these in order Avoid damage to equipment and material Get the job done Avoid injuries Maintain good community relations

13 X 11 Normal World Avoid injuries Avoid damage to equipment and material Get the job done Maintain good community relations

13 X 11 Get the job done Avoid injuries Avoid damage to equipment and material Maintain good community relations

13 X 11 Ballistics  ? v0v0

13 X 11 Ballistics  v0v0

13 X 11 Ballistics  vxvx vyvy v0v0

13 X 11 Ballistics  vxvx vyvy v0v0 t

13 X 11 Ballistics  vxvx vyvy v0v0 t t

13 X 11 Ballistics  vxvx vyvy v0v0 t t

13 X 11 Ballistics  vxvx vyvy v0v0 t t Assumptions Flat non-rotating earth Vacuum Constant gravity

13 X 11 Ballistics Calculations Required rooms full of mathematicians Very slow, tedious work Anything that would help could help to win the war Money no object Commercialization not considered Software Engineering?

13 X 11 Let's invent a computer

13 X 11 Computer Programming Initially by hand Big breakthrough: Machine translation Analysis of computation Church-Turing Functional Imperative/Procedural

13 X 11 Paradigm Review Functional Programming –Mathematical base –Provably correct –Disassociated from machine model Imperative/Procedural Programming –Machine oriented –Mathematical ties Object Oriented Programming –Some features of both –Result of industry maturation & growth

13 X 11 Origins of OO USAF ATC Randolph AFB B220 Locations Routines Data

13 X 11 Origins of OO USAF ATC Randolph AFB B220 Simulation Machines Workers Products Conveyor

13 X 11 Origins of OO USAF ATC Randolph AFB B220 Simulation Large scale projects

13 X 11 Origins of OO USAF ATC Randolph AFB B220 Simulation Large scale projects GUI's

13 X 11 So what is it? A brief overview My favorite example Queue

13 X 11 Chez Guillaume Application to maintain 2 queues Allow adding to either list Allow removing from either list

13 X 11 How might it be done? Enqueue Module Dequeue Module isEmpty Module head.tail Restaurant Module head.tail Input Module Output Module Menu Module Data Structure

13 X 11 How might it be done? Enqueue Module Dequeue Module isEmpty Module head.tail Restaurant Module head.tail Input Module Output Module Menu Module Data Structure Where is the queue?

The OO Approach Restaurant Object Input Module Output Module Menu Module Data Objects Queue Object Enqueue Module Dequeue Module isEmpty Module head.tail Queue Object head.tail Enqueue Module Dequeue Module isEmpty Module Data Object Get Data Module Set Data Module Cust Data Ref

13 X 11 The OO Approach Why do we want a new language? Why do we want to arrange things in such a fashion? What are the goals?

13 X 11 Goals Encapsulation Reusability Adaptability/Flexibility Decentralization/Distribution

13 X 11 OOP Terminology Abstract Data Type Class Object Method Fields/Attributes References

13 X 11 Characteristics of OOP Language Everything is an object A program is a bunch of objects telling each other what to do by sending each other messages Each object has its own memory made up of other objects Every object has a type which in OO terms means that every object is an instance of some class All objects of a particular type can receive the same messages. An object of type circle will also be an object of type shape thus...

13 X 11 Java Toasters Smart cards Killer apps The wwweb

13 X 11 Java, the good news Real Very powerful In demand Software engineering Universal

13 X 11 Java, the bad news Real Very powerful Not an educational language Jack of all trades/Master of none Slow

13 X 11 Clever Java Stuff Java program can be run by web browser Borrowed a lot of syntax from c and c++ Give it away WORA Security

13 X 11 Translation Compilation –Fortran –Cobol –Pascal –Algol –C/C++ Interpretation –Basic –Lisp –Scheme

13 X 11 Emulation How to sell a new computer to someone with lots of software? Emulate the old hardware! Old Software New Computer Program Emulating Old Computer

13 X 11 The Java Approach Compilation into ByteCode Java Source Byte Code Javac Compiler

13 X 11 The Java Approach Interpretation by the Java Virtual Machine Any Computer Java Virtual Machine Byte Code

13 X 11 Why is this cool?

13 X 11 The Internet ©Al Gore Java Source Byte Code Javac Compiler Do this once Web Server Your Computer Your Favorite Browser Java Virtual Machine

13 X 11 “Source Code” [.java] Java compiler Generic “Byte Code” [.class] OS-specific JVM interpreter Execute program Compilation/Execution Need one of these for every different OS

13 X 11 Sample Application public class HelloWorld { public static void main(String argv[]) { System.out.println(“Hello World!”); } We create a file (using an editor) called “HelloWorld.java” We compile by typing (at the OS prompt): javac HelloWorld.java Which produces HelloWorld.class Then we execute by typing: java HelloWorld Hello World!

13 X 11 Demo >javac HelloWorld.java >java HelloWorld Hello World! >

13 X 11 Quick Trix The name of the file must match the name of the class EXACTLY!!! File: Bubba.java Contains: Everything must be EXACTLY correct!!! class Bubba {... Capitalization counts

13 X 11 A Final Word static static is a source of great confusion and sometimes even frustration Here's the basic idea (don't worry if this is confusing we'll explain it again and again

13 X 11 Java Structure Java programs consist entirely of files containing classes Classes are like blueprints or templates They describe the structure and operation of objects. Objects are like whatever is made from a blueprints or template. Objects are considered to be dynamic Sometimes there is a need for something to not be dynamic hence you may declare it static.

13 X 11 Questions?

13 X 11