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,

Slides:



Advertisements
Similar presentations
Your First Java Program: HelloWorld.java
Advertisements

Chapter 2: Your First Program! Hello World: Let’s Program  All programs must have the extension.java  Our first program will be named: HelloWorld.java.
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
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,
Hello, world! Dissect HelloWorld.java Compile it Run it.
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.
Getting Started with Java
Getting Started What is Java? A programming language –Fully buzzword-compliant: A simple, object oriented, distributed, interpreted, robust, secure,
IB Computer Science II Paul Bui
“Introduction to Programming With Java”
Lecture 1 Introduction to Java MIT- AITI 2004 What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word.
+ 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 Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
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.
Tutorial 1. Q1: Compare and contrast between multiprocessors and multicore Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel.
Welcome to the Lecture Series on “Introduction to Programming With Java”
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.
1 Introduction to Java Brief history of Java Sample Java Program Compiling & Executing Reading: => Section 1.1.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Java Spring PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
POS 406 Java Technology And Beginning Java Code
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Compiling and the Java Virtual Machine (JVM). The syntax of Pseudocode is pretty loose –visual validation encourages a permissive approach –emphasized.
Software for Translators Barcelona, January 2002.
C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A.
Lecture 3 January 14, 2002 CSC Programming I Fall 2001.
Methods F Hello World! F Java program compilation F Introducing Methods F Declaring Methods F Calling Methods F Passing Parameters by value F Overloading.
JAVA PROGRAMMING BASICS CHAPTER 2. History of Java Begin with project Green in 1991 founded by Patrick Noughton, Mike Sheridan and James Gosling who worked.
A First Simple Program /* This is a simple Java program. Call this file "Example.java".*/ class Example { // Your program begins with a call to main().
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
The 1 st and 2 nd tutoring session of CSc2310 Fall, 2012 Haidong Xue.
Mini University July, 2005 A Little Taste of Java (but don’t tell your folks) (they might think there’s caffeine involved)
Getting Started.
 Instructor: Dr. Jason Nichols –  Office Hours: – 9:30-10:30 M/W/F or by appointment – Business Building.
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
A Look at Java. Categorize Java Which paradigm? Which paradigm? Scripting? Scripting? Declarative or procedural? Declarative or procedural? Which generation?
CSI 3125, Preliminaries, page 1 Compiling the Program.
CSc 201 Introduction to Java George Wells Room 007, Hamilton Building
Java FilesOops - Mistake Java lingoSyntax
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.
COP-3330: Object Oriented Programming Course Introduction May 14, 2012 Eng. Hector M Lugo-Cordero, MS.
Introduction to java (class and object). Programming languages: –Easier to understand than CPU instructions –Needs to be translated for the CPU to understand.
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.
Introduction to programming in java
Computer Programming Your First Java Program: HelloWorld.java.
Introduction of Java Fikri Fadlillah, S.T.
Exercise Java programming
GC101 Introduction to computer and program
Compiling and Running a Java Program
Introduction to.
CompSci 230 Software Construction
Java Intro III.1 (Fr Feb 23).
Tonga Institute of Higher Education
Fundamentals of Programming
Java Intro.
Introduction to Java Brief history of Java Sample Java Program
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
IB Computer Science II Paul Bui
Road to Object Oriented Programming
Presentation transcript:

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, … Intended to be a safe programming language for the Internet Common choice for first programming language  Object oriented  Encourages good programming habits  Very popular commercially  Simpler and more elegant than C++, but similar to it  Cool

Slide 2 of 40. Lecture A Hello World Program // My First Program!! public class HelloWorld { public static void main(String[] args){ System.out.println(“Hello World!”); }

Slide 3 of 40. Lecture A Java Program Elements Words  Keywords  Identifiers Constants  Numbers  Strings Symbols  ( ) [ ] { },. ; + - * / Comments

Slide 4 of 40. Lecture A Java Elements // My First Program!! public class HelloWorld { public static void main(String[] args){ System.out.println(“Hello World!”); } Comment Identifier Symbols Keywords String Constant

Slide 5 of 40. Lecture A Java Program Structure A program is composed of a collection of classes Each class contains a collection of methods Each method is composed of a sequence of instructions (commands, statements)

Slide 6 of 40. Lecture A Java Program Structure // My First Program!! public class HelloWorld { public static void main(String[] args){ System.out.println(“Hello World!”); } Class Method Instruction

Slide 7 of 40. Lecture A Running a Java Program Use an editor to enter (type) the program  Save to a file named HelloWorld.java Use the compiler to translate the program into bytecode  javac HelloWorld.java  This produces a file named HelloWorld.class Run the program using the Interpreter  java HelloWorld

Slide 8 of 40. Lecture A Java Compilation Compiler Xxx.java Xxx.class Interpreter Output

Slide 9 of 40. Lecture A Entering a Java Program into an Editor

Slide 10 of 40. Lecture A Running a Java Program