A Look at Java. Categorize Java Which paradigm? Which paradigm? Scripting? Scripting? Declarative or procedural? Declarative or procedural? Which generation?

Slides:



Advertisements
Similar presentations
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Advertisements

Object Oriented Programming in Java George Mason University Fall 2011
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
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,
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
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.
Introduction to Java.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
IB Computer Science II Paul Bui
Programming in Java; Instructor:Moorthy Introduction, Objects, Classes, Libraries1 Programming in Java Introduction.
+ 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.
CSCI 273: Processing An Introduction. Programming Languages –An abstract "human understandable" language for telling the computer what to do –The abstract.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
COMP 110 Spring Announcements Computers in class on Friday: Lab Office Hours: Monday 12-2 New students see me after class Administrative Changes.
COMP 110: Introduction to Programming Tyler Johnson January 14, 2009 MWF 11:00AM-12:15PM Sitterson 014.
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.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
CS107 Introduction to Computer Science Java Basics.
Java Programming Introduction & Concepts. Introduction to Java Developed at Sun Microsystems by James Gosling in 1991 Object Oriented Free Compiled and.
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.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
FRST JAVA PROGRAM. Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Introduction to C++ Programming Language
Week 1 - Friday.  What did we talk about last time?  Our first Java program.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
2-1 Hardware CPU Memory - 2 kinds Network Graphics Input and Output Devices.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
Creating Your First Computer Program in Java Margaret Yau.
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.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Java Basics 1 Brief History of Java and Overview of Langauge.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
CSI 3125, Preliminaries, page 1 Compiling the Program.
Java and C++ Transitioning. A simple example public class HelloWorldApp { public static void main(String[] args) { //Display the string. System.out.println("Hello.
By: Cheryl Mok & Sarah Tan. Java is partially interpreted. 1. Programmer writes a program in textual form 2. Runs the compiler, which converts the textual.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
introductory lecture on java programming
Getting Started With Java September 22, Java Bytecode  Bytecode : is a highly optimized set of instructions designed to be executed by the Java.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Introduction to java (class and object). Programming languages: –Easier to understand than CPU instructions –Needs to be translated for the CPU to understand.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
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.
Dept of Computer Science University of Maryland College Park
John Woodward A Simple Program – Hello world
GC101 Introduction to computer and program
Introduction to.
Internet and Java Foundations, Programming and Practice
Java Intro III.1 (Fr Feb 23).
Introduction to Algorithm Design
Java Intro.
IB Computer Science II Paul Bui
Computer Programming-1 CSC 111
Presentation transcript:

A Look at Java

Categorize Java Which paradigm? Which paradigm? Scripting? Scripting? Declarative or procedural? Declarative or procedural? Which generation? Which generation? Low, high, or very high level? Low, high, or very high level? Compiled or interpreted? Compiled or interpreted?

How Programming Works: Pre-Java 1. Programmer types a program into a text editor. This code is called the source code.This code is called the source code. It is saved as a file on your computer, much like any other file you create.It is saved as a file on your computer, much like any other file you create. Since the code is human- readable, it is usually kept private.Since the code is human- readable, it is usually kept private. #include main() { cout << "Hello World!"; return 0; }

How Programming Works: Pre-Java 1. Source Code 2. A program called a compiler reads the code and makes machine code instructions specific to the type of machine you are running on. This code is NOT human- readable. This code is NOT human- readable. This is what comes on software CDs, so that the code remains proprietary. This is what comes on software CDs, so that the code remains proprietary. #include main() { cout << "Hello World!"; return 0; } _main _TEXT SEGMENT _argc$ = 8 _argv$ = 12 _main PROC NEAR ; COMDAT push OFFSET e call _printf 0000a 83 c4 04 add esp, d 33 c0 xor eax, eax Compiler

How Programming Works: Pre-Java 1. Source Code 2. Compiled to Machine Code 3. Run on the computer - Now the program can be run, but only on the machine it was compiled for. #include main() { cout << "Hello World!"; return 0; } _main _TEXT SEGMENT _argc$ = 8 _argv$ = 12 _main PROC NEAR ; COMDAT push OFFSET e call _printf 0000a 83 c4 04 add esp, d 33 c0 xor eax, eax Compiler Hello World! Executed by a machine with Intel 32-bit processor

Java Programming Language James Gosling, Sun Microsystems, 1991 James Gosling, Sun Microsystems, 1991 Idea: Want a computer application to control the appliances in a home Idea: Want a computer application to control the appliances in a home But - different chips on each But - different chips on each Need: Programming language that works on any machine Need: Programming language that works on any machine 3 years later, Internet hits, and we realize portability is a great idea… 3 years later, Internet hits, and we realize portability is a great idea…

How Java Programming Works 1. Programmer types a program into a text editor. This code is called the source code.This code is called the source code. It is saved as a file on your computer, much like any other file you create.It is saved as a file on your computer, much like any other file you create. Since the code is human- readable, it is usually kept private.Since the code is human- readable, it is usually kept private. public class Hello{ public static void main( String[] args){ System.out.println( “Hello World!”); }

How Java Programming Works 1. Source Code 2. The Java compiler reads the code and makes an intermediate code called bytecode. Again, this code is NOT human-readable. Again, this code is NOT human-readable. Again, this is what comes on software CDs, so that the code remains proprietary. Again, this is what comes on software CDs, so that the code remains proprietary. public class Hello{ public static void main( String[] args){ System.out.println( “Hello World!”); } 0: iconst_2 1: istore_1 2: iload_1 3: sipush : if_icmpge 44 9: iconst_2 10: istore_2 11: iload_2 12: iload_1 13: if_icmpge 31 Java Compiler: Same for all machines

How Java Programming Works 1. Source Code 2. Compiled to Bytecode 3. Interpreted by JVM (Java Virtual Machine) This program reads bytecode and translates it directly to whatever machine code is needed. public class Hello{ public static void main( String[] args){ System.out.println( “Hello World!”); } _main _TEXT SEGMENT _argc$ = 8 _argv$ = 12 _main PROC NEAR ; COMDAT push OFFSET e call _printf 0000a 83 c4 04 add esp, d 33 c0 xor eax, eax Interpreted by JVM Java Compiler: Same for all machines 0: iconst_2 1: istore_1 2: iload_1 3: sipush : if_icmpge 44 9: iconst_2 10: istore_2 11: iload_2 12: iload_1 13: if_icmpge 31

How Java Programming Works 1. Source Code 2. Compiled to Bytecode 3. Interpreted by JVM to Machine Code 4. Executed by machine public class Hello{ public static void main( String[] args){ System.out.println( “Hello World!”); } _main _TEXT SEGMENT _argc$ = 8 _argv$ = 12 _main PROC NEAR ; COMDAT push OFFSET e call _printf 0000a 83 c4 04 add esp, d 33 c0 xor eax, eax Interpreted by JVM Java Compiler: Same for all machines 0: iconst_2 1: istore_1 2: iload_1 3: sipush : if_icmpge 44 9: iconst_2 10: istore_2 11: iload_2 12: iload_1 13: if_icmpge 31 Hello World!

Java Overview public class Hello{ public static void main(String[] args){ System.out.println(“Hello World!”); } _main _TEXT SEGMENT _argc$ = 8 _argv$ = 12 _main PROC 0: iconst_2 1: istore_1 2: iload_1 3: sipush 1000 Hello World! e a 83 NEAR ; COMDAT push e call 0000a 83 c4 04 add esp, 0000d 33 c0 xor eax, Source Code: MUST be named Hello.java Bytecode: will be saved as Hello.class Mac Whatever UnixWindows

So, what about Eclipse? What is eclipse? What is eclipse? How does it work? How does it work? What languages will it work for? What languages will it work for?