Java Spring 2010. PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What.

Slides:



Advertisements
Similar presentations
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore G54PRG Programming Lecture 1 Amadeo Ascó 3 Java Programming Language.
Advertisements

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.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
JAVA BASICS SYNTAX, ERRORS, AND DEBUGGING. GCOC – A.P. Computer Science A College Board Computer Science A Topics Covered Program Design - Read and understand.
Lab#1 (14/3/1431h) Introduction To java programming cs425
April 20023CSG11 Electronic Commerce Java (1) John Wordsworth Department of Computer Science The University of Reading Room 129,
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
Introduction to Java CS 331. Introduction Present the syntax of Java Introduce the Java API Demonstrate how to build –stand-alone Java programs –Java.
Introduction to the JDK Java for Computational Finance
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
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.
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
Introduction to Java Tonga Institute of Higher Education.
Introduction to Java Programming CS 21a: Introduction to Computing I First Semester,
+ 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.
Java Programming Robert Chatley William Lee
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
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.
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.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Java Spring PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
JAVA Java is a programming language and computing platform first released by Sun Microsystems in It was first developed by James Gosling at Sun Microsystems,
© 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.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
PImage. Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What about the constructor---how.
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.
CT1513 Introduction To java © A.AlOsaimi.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
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.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
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.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette August 27, 2004 Last update:
Java FilesOops - Mistake Java lingoSyntax
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 -
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
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.
Electronic Commerce Java (1)
Applications Active Web Documents Active Web Documents.
JAVA, JAVA Applets, and JavaScript
Before You Begin Nahla Abuel-ola /WIT.
Introduction to.
Internet and Java Foundations, Programming and Practice
Introduction to Java Dept. Business Computing University of Winnipeg
Your First Java Application
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Presentation transcript:

Java Spring 2010

PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What about the constructor---how many parameters does it have? There are 4 constructors each with a different number of parameters

PImage Revisited Here’s an alternative way of looking at the documentation for PImagePImage This documentation is produced by Javadoc Javadoc Processing is implemented as a set of Java classes that accompany those normally provided with Java Can you find the line() method?

Java Java is a programming language developed by Sun Microsystems in Java is one of the first languages to be platform independent. –Java is compiled to byte-code that runs on a Java interpreter A Java program never executes directly (i.e., natively) on a machine; instead the Java interpreter reads the byte code and executes the corresponding native machine instructions. To run Java programs on a computer, all that is needed is the interpreter (java virtual machine) and some library routines (the API)

Ways to run Java Java is rarely run as an “application” –Such as for forecasting weather Applet –Runs within a browser window –Superclass of Processing PApplet Web application –Runs on a web server Javascript is not Java

The Java API The Java API is the code that comes with the java interpreter (a.k.a. the java virtual machine) when you download java. The java API is a collection of Java classes---take a look at the API for Java 6 (aka 1.6)API for Java 6 (aka 1.6) See if you can find the String class.

Running Java outside of Processing If the instructor is so inclined, you’ll be show how to run the following exciting Java application under a Java IDE Otherwise, you’ll just look at the code. (Or maybe not even that.)

Pets public class Pets { /* Creates a Cat and a Dog */ public static void main (String [] args) { Cat tom = new Cat (); // create Cat object Dog spike = new Dog; // create Dog object // demonstrate Cat behavior tom.bite (spike); System.out.println (); // Skip a line of output // demonstrate Dog behavior spike.beenBittenBy (tom); }

The cat public class Cat { public void hiss () { System.out.println ("Hiss!"); } public void scratch (Dog victum) { System.out.println ("I'm scratching the dog"); victum.growl (); } public void bite (Dog sillyDog) { System.out.println ("I'm bitting the dog"); sillyDog.yelp (); scratch (sillyDog); }

The Dog public class Dog { public void bark () { System.out.println ("Arf!"); } public void growl () { System.out.println ("Grrrr!"); } public void yelp () { System.out.println ("Awooo!"); } public void beenBittenBy (Cat sillyCat) { System.out.println("I've been bitten by a cat with a mean hiss:"); sillyCat.hiss (); }