Computer Programming 12 Mr. Jean March 3 rd, 2014.

Slides:



Advertisements
Similar presentations
compilers and interpreters
Advertisements

Chapter 2 First Java Programs
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Chapter 1 Introduction to JAVA. Why Learn JAVA? Java is one of the fastest growing programming language in the world. Java is one of the fastest growing.
Chapter 1: Introduction
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Chapter 1 These slides for CSE 110 Sections are based in part on the textbook-authors’ slides, which are copyright by the authors. The authors state that.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
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.
Compilers and Interpreters. Translation to machine language Every high level language needs to be translated to machine code There are different ways.
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Chapter 2 First Java Programs
1 CSC 551: Web Programming Spring 2004 Java Overview  Design goals & features  platform independence, portable, secure, simple, object-oriented, … 
1.1 History of Computers 1940s: The ENIAC was one of the world’s first computers. Large stand-alone machine Used large amounts of electricity Contained.
Introducing Java.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
+ 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.
Lesson 2: First Java Programs
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
 Java Programming Environment  Creating Simple Java Application  Lexical Issues  Java Class Library.
Java Lecture 16: Dolores Zage. WWW n Was a method for distributing passive information n added forms and image maps n interaction was only a new way to.
1 Chapter 2 First Java Programs Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Computer Programming 12 Mr. Jean March 19 th, 2013.
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.
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.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Lesson 2: First Java Programs. Objectives: –Discuss why Java is an important programming language. –Explain the Java virtual machine and byte code. –Choose.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
POS 406 Java Technology And Beginning Java Code
Java Programming, Second Edition Chapter One Creating Your First Java Program.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Fall 2006Slides adapted from Java Concepts companion slides1 Introduction Advanced Programming ICOM 4015 Lecture 1 Reading: Java Concepts Chapter 1.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
We will talking about story of JAVA language. By Kristsada Songpartom.
CT1513 Introduction To java © A.AlOsaimi.
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.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
JAVA Practical Creating our first program 2. Source code file 3. Class file 4. Understanding the different parts of our program 5. Escape characters.
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.
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.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
Chapter 1 Introduction. Chapter Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Chapter 2 First Java Programs Fundamentals of Java.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
1 Sections Java Virtual Machine and Byte Code Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Lesson 2: First Java Programs. 2.1 Why Java? Java is one of the most popular programming languages in the world. Java is a modern object-oriented programming.
Programs and Models Almost all computer programs model some artifact – Artifact: product of civilization, either concrete or abstract, simple or complex.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
GC101 Introduction to computer and program
Chapter 1 Introduction to Computers, Programs, and Java
Introduction to.
Text by: Lambert and Osborne
Chapter 2 First Java Programs
Introduction to Java Dept. Business Computing University of Winnipeg
Introduction CSC 111.
(Computer fundamental Lab)
Chap 1. Getting Started Objectives
Presentation transcript:

Computer Programming 12 Mr. Jean March 3 rd, 2014

The plan: Video Clip of the day Why Java? Using Jcreator Learning how to create a project in Jcreator

2.1 Why Java? Java is the fastest growing programming language in the world. Java is a modern object-oriented programming language. Java has benefited by learning from the less desirable features of early object-oriented programming languages.

2.1 Why Java? Java is ideally suited to develop distributed, network-based applications because it: –Enables the construction of virus-free, tamper-free systems (security) –Supports the development of programs that do not overwrite memory (robust) –Yields programs that can be run on different types of computers without change (portable)

2.1 Why Java? Java supports advanced programming concepts such as threads. –A thread is a process that can run concurrently with other processes. Java resembles C++, the world’s most popular industrial strength programming language. Java however, runs more slowly than most modern programming languages because it is interpreted.

2.2 The Java Virtual Machine and Byte Code Java compilers translate Java into pseudomachine language called java byte code. To run java byte code on a particular computer, a Java virtual machine (JVM) must be installed.

2.2 The Java Virtual Machine and Byte Code A Java virtual machine is a program that acts like a computer. It is called an interpreter. Disadvantage: –Runs more slowly than an actual computer To combat slower processing, some JVMs translate code when first encountered. This is known as just-in-time compilation (JIT).

2.2 The Java Virtual Machine and Byte Code Advantages: –Portability. Any computer can run Java byte code. –Applets. Applets are small Java programs already translated into byte code. Applets run in a JVM incorporated in a web browser Applets can be decorative (like animated characters on a web page.) Applets can be practical (like continuous streams of stock market quotes.) –Security. It is possible to limit the capabilities of a Java program since it runs inside a virtual machine.

How to build new projects:

Today’s Goals: We will be introduced to classes and static methods and are shown how to compile and run a Java program.

First Program in Java This simple program causes the word “Hello” to be printed. To start: –Find jcreator on your computer –Open jcreator and copy to code from my PPT onto your jcreator

J-creator Video: 3NYPE (Getting Started) 3NYPE oO8zLg (Hello World) oO8zLg 8Hto (About Java & Applications) 8Hto

Compiling & Running a program A Java program must be compiled before it can be run by the Java system (Java Virtual Machine). –The complier translates the Java program into the underlying Java machine language (called Java byte codes) and creates a file containing the result. –This file (also called the class file) is used by the Java system to run (or execute) the program producing the program output.

When the program is run the system looks for the main method and begins with the first instruction and then the further instructions in order. Most methods contain many instructions. In Java instructions are called statements. –Statements are executed. The program above contains the single statement that causes the word (or string) Hello to be printed. –System.out.println("Hello");

Creating an error: One of the functions of the compiler is to detect syntax errors. Deliberately introduce small syntax errors and observe the results.

Common Errors: When using JavaRoom, if the name of the class containing the main method is not the same as the name of the file, the name of the class must be selected before clicking the run button.

About our Program: Our program consists of a class containing a main method (a method with the name main). –the name of the class is HelloTester. –the class contains a main method which must be public (otherwise it will not run) –static(because it is not part of any object) –void (because it does not return any value). In this case the method contains only one instruction (statement) which is a call to the println method in the out object in the System class.

Adding information: It is important to tell other programmers what you are doing In order to do this you must start with start with “/*” and end with “*/”