Introduction to Java Programming CS 21a: Introduction to Computing I First Semester, 2013-2014.

Slides:



Advertisements
Similar presentations
A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
Advertisements

ASP.NET Intro An introduction to the languages and communication of an ASP.NET system.
In Review JAVA C++ GUIs - Windows Webopedia.com.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Introduction to Java Kiyeol Ryu Java Programming Language.
Aalborg Media Lab 18-Jun-15 Introduction Introduction to System Design I Fall 2004.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
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,
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 Object-Oriented Languages.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Applets, HTML and GUI’s Recitation – 04/11/2008 CS 180 Department of Computer Science, Purdue University.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
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 Programming CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University.
CSE 452: Programming Languages Java and its Evolution.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
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.
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.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Applets Chapter 17.  Java’s big splash onto the scene came in the mid 90’s. The people at Sun Microsystems had managed to work java programs into Web.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Chapter 17: Applets, Images, and Sound. Objectives Learn about applets Write an HTML document to host an applet Use the init() method Work with JApplet.
Introduction to Java and Object-Oriented Programming AJSS Computer Camp Department of Information Systems and Computer Science Ateneo de Manila University.
1 Part I : Chapter 01 Introduction to Java Programming.
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Java Applets. 2 Introduction to Java Applet Programs  Applications are stand alone programs executed with Java interpreter executed with Java interpreter.
OOP (Java): Simple/ OOP (Java) Objectives – –give some simple examples of Java applications and one applet 2. Simple Java Programs Semester.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Clement Allen, PhD Florida A&M University SUMMER 2006.
1 Programming Fundamentals AITI-GP. 2 Introduction to Programming.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
Introduction to Java Applets Sangeetha Parthasarathy 05/21/2001.
Applets. What is an applet? Why create applets instead of applications? – Applets are Java programs that can be embedded in an HTML document – In contrast,
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
Java Programming Lecture 1 Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Java applets. Outline What is Java? Java Applications Java Applets Java Applets Securities Summary.
Creating Your First Computer Program in Java Margaret Yau.
Mini University July, 2005 A Little Taste of Java (but don’t tell your folks) (they might think there’s caffeine involved)
Java and its Evolution. Contents Java Introduction Java Features How Java Differs from other OO languages Java and the World Wide Web Java Environment.
Applets and Frames. Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L14: GUI Slide 2 Applets Usually.
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.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
Chapter 1: An Overview of Computers and Programming Languages
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.
Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of.
1 Applets. 2 Design of Applets 3 Sun wrote Java to be executable within a hosting application browser The applications are applets. An applet is downloaded.
Introduction to Programming. The Programming Process Create/Edit Program Compile Program Execute Program Compile Errors?Run-Time Errors? Source Program.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
CSI 3125, Preliminaries, page 1 Applet. CSI 3125, Preliminaries, page 2 Applet An applet is a Java program that runs in a Web browser. An applet can be.
HTML HyperText Markup Language Victoria E. Kozlek.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
Applets. 9/04/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L12: Applets Slide 2 Applets Usually.
1 Applets Programming. Introduction Java programs are divided into two main categories, applets and applications. An application is an ordinary Java program.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Introduction to.
Advanced Programming Fall 2017.
UNIT-5.
Java Applets.
Introduction CSC 111.
Debugging Exercise 00 Try compiling the code samples.
Chap 1. Getting Started Objectives
A Brief History January 1996: first official release JDK 1.0
Presentation transcript:

Introduction to Java Programming CS 21a: Introduction to Computing I First Semester,

Programming ► Recall that a program is defined as: a sequence of instructions for a computer ► A large part (but not all) of CS 21a is about how to write programs in a programming language (Java)

The Java Programming Language ► Java: an object-oriented programming language that is ► simple ► safe ► platform independent ► designed for the internet ► Many universities use Java as the introductory programming language for beginning programmers ► Ateneo adopted Java for CS 21a in 1997

Java (a brief history) ► 1991 ► Sun Microsystems develops a language (based on C) for consumer electronic devices ► 1993 ► WWW explodes in popularity ► increased need for "dynamic" Web pages ► 1995 ► Sun formally announces Java for web use

Two Types of Java Programs ► Applications ► general-purpose programs ► standalone ► executed through the operating system ► Applets ► programs meant for the WWW ► embedded in a Web page ► normally executed through a browser

Simple Java Application File: Hello.java // Hello World application public class Hello { public static void main( String args[] ) { System.out.println( "Hello world" ); }

The Programming Process Create/Edit Program Compile Program Execute Program Compile Errors?Run-Time Errors? Source Program Object Program

Creation, Compilation, and Execution ► Create Java program C:\> edit Hello.java ► Hello.java file is created ► Compile using javac (compiler) C:\> javac Hello.java ► Hello.class file is produced ► Execute using java (interpreter) C:\>java Hello ► requires a Hello.class file

Simple Java Applet File: HelloAgain.java import javax.swing.*; import java.awt.*; public class HelloAgain extends JApplet { public void paint( Graphics g ) { g.drawString( "Hello", 50, 50 ); }

Executing Applets After compiling the java program: ► Embed an "applet tag" in an.html document that references the.class file ► Open the.html document using a browser or the appletviewer

Sample.html Document File: HA.html My Sample Applet

What is HTML? ► Hypertext Markup Language ► Underlying language of Web pages ► A means of providing formatting instructions for presenting content ► Text-based ►.html documents: ► collection of content and controls (tags)

Java Program Structure ► Java Program ► (optional) import declarations ► class declaration ► Class ► class name should match its file name ► may extend an existing class (such as JApplet) ► contains method/function declarations