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.

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

compilers and interpreters
In Review JAVA C++ GUIs - Windows Webopedia.com.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
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 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
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.
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
1 Programming & Programming Languages Overview l Machine operations and machine language. l Example of machine language. l Different types of processor.
JAVA ENVIRONMENT JDK, API, JVM. JAVA ENVIRONMENT  Java environment includes development tools and many classes and methods. Java Environment JDK (Java.
Introduction to Java.
Using the Java programming language compiler. Review of relevant material from previous lectures From previous lectures: A computer can only execute machine.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 1
Introduction to Java Tonga Institute of Higher Education.
Introducing Java.
Chapter 1 Coding Introduction.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Chapter 1 What is Programming? Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
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.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Introduction to Computer Systems and the Java Programming Language.
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.
Introduction to C++ Programming Language
Getting started with Programming using IDE. JAVA JAVA IS A PROGRAMMING LANGUAGE AND A PLATFORM. IT CAN BE USED TO DELIVER AND RUN HIGHLY INTERACTIVE DYNAMIC.
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
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.
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.
Getting Started With Java September 22, Java Bytecode  Bytecode : is a highly optimized set of instructions designed to be executed by the Java.
Installing Java on a Home machine For Windows Users: Download/Install: Go to downloads html.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
1 Introduction Read D&D Sec 1.8; Sec 1.13 THE Java tutorial -
Compilers and Interpreters
Representation of Data - Instructions Start of the lesson: Open this PowerPoint from the A451 page – Representation of Data/ Instructions How confident.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
What Do Computers Do? A computer system is
Installing Java on a Home machine
Why don’t programmers have to program in machine code?
Lecture 1b- Introduction
Before You Begin Nahla Abuel-ola /WIT.
Writing, Compiling and Running a C program
Programming languages
Programming Language Hierarchy, Phases of a Java Program
CSCI-235 Micro-Computer Applications
Topic: Difference b/w JDK, JRE, JIT, JVM
Java programming lecture one
Introduction to Java Dept. Business Computing University of Winnipeg
Assembler, Compiler, Interpreter
Installing Java on a Home machine
Introduction CSC 111.
Assembler, Compiler, Interpreter
(Computer fundamental Lab)
Review of Previous Lesson
Programming language translators
Presentation transcript:

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 current problem (Analysis) –Transform this model to logical models (Design) –Transform this model to software (implementation) Need to translate model to something computers can understand (mathematical equations)

Parlez Vous Binary? How do we translate our business problem into machine code? Initially, a programmer writes a program in a particular programming language. This is called source code!!!!! To execute the program however, the programmer must translate it into machine language……the language that the computer understands. How do we do this? –A COMPILER does this!!!!!

Compiler A compiler converts source code into machine level instructions Almost every programming language comes with a compiler In effect, the compiler is the language because it defines which instructions are acceptable

Javac The Java compiler (javac) is the component of the Java Developers kit (JDK) USED TO TRANSFORM Java source code files into bytecode (not machine code) Bytecode is the compiled format for Java programs. Once a Java program has been converted to bytecode, it can be transferred across a network and executed by the Java Virtual Machine

Java Virtual Machine Bytecode is not really machine code and cannot be used by a computer – it must be interpreted The Java Virtual Machine (JVM) is an interpreter, it interprets byte code and can thus execute quickly The Java interpreter is built into Java compatible web browsers such as Internet Explorer

Why Compile and Interpret? Because byte code is used instead of machine code, a java program can be executed on any machine that has a Java interpreter This makes java extremely portable……a program can be compiled on one machine and executed on any Java used extensively on web sites Java not only offers portability but identical behaviour on different systems “WRITE ONCE, RUN EVERYWHERE”

Compiling and interpreting Java source code is written with a text editor and saved in plain ASCII text with file extension.java These files are compiled using the javac compiler –E.g. javac Examplehelloworld.java Executable bytecode class files have the extension.class and they represent a Java class in its usable form The Java compiler generates exactly one.class file for each class you create. It is possible to define more than one class in a single source file, it is therefore possible for the compiler to generate multiple class files from a single source file.