Introduction CMSC 202 Fall 2011 1. Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.

Slides:



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

Object Oriented Programming in Java George Mason University Fall 2011
CMSC 202 Fall 2010, Advanced Section Designing with Objects.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
Introduction to Java.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
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.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Introduction to Java Programming. Contents 1. Java, etc. 2. Java's Advantages 3. Java's Disadvantages 4. Types of Java Code 5. Java Bytecodes 6. Steps.
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
+ 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.
Lecture1: Introduction Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Introduction to Programming Languages. Problem Solving in Programming.
 2003 Joel C. Adams. All Rights Reserved. Calvin CollegeDept of Computer Science(1/10) An Overview of Objects and the Java API Joel Adams and Jeremy Frens.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
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.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
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-
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Java Introduction 1. Introduction to Java Programming2 Computers and Computer Languages Computers are everywhere –how many computers do you own? Computers.
Clement Allen, PhD Florida A&M University SUMMER 2006.
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
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.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
CS Software Studio Java Lab 1 Meng-Ting Wang PLLAB, Computer Science Department, National Tsing-Hua University.
Introduction to Java The Java Platform, The Java Language, JDK, Eclipse Svetlin Nakov Technical Trainer Software University
Creating Your First Computer Program in Java Margaret Yau.
We will talking about story of JAVA language. By Kristsada Songpartom.
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.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
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.
The Java Platform, The Java Language, JDK, IntelliJ
Application Architecture Using Java Hong Li. Introduction Developed by a team led by James Gosling at Sun Microsystem. Originally called Oak, designed.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
introductory lecture on java programming
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
CSCI 212 Object-Oriented Programming in Java. Prerequisite: CSCI 111 variable assignment statement while loop for loop post-increment (i++) strong typing.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
ITP 109 Week 2 Trina Gregory Introduction to Java.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Introduction to JAVA Programming
CMSC 202 Computer Science II for Majors Fall 2010 Introduction Version 9/101.
CMSC202 Computer Science II for Majors Lecture 01 – Introduction and C++ Primer Dr. Katherine Gibson Based on slides by Chris Marron at UMBC.
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.
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.
Object Oriented Programming in
Lecture 1b- Introduction
Before You Begin Nahla Abuel-ola /WIT.
GC101 Introduction to computer and program
Chapter 1 Introduction to Computers, Programs, and Java
Java programming lecture one
Getting Started ARCS Lab..
Java History, Editions, Version Features
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

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 10:00 – 11:15 am, Sondheim 114 – Lecture Section 10 Mon/Wed 8:30 – 9:45 am, Sondheim 110 Ms. Susan Mitchell – Lecture Section 07 Mon/Wed 5:30 – 6:45 pm, Sondheim 204 2

What is CMSC 202? An introduction to object-oriented programming (OOP) and object-oriented design (OOD) Uses the Java programming language Uses the Eclipse integrated development environment (IDE) Strong emphasis on proper program design Course website: 3

Procedural vs. OO Programming Procedural Modular units: functions Program structure: hierarchical Data and operations are not bound to each other Examples: – C, Pascal, Basic, Python Object-Oriented (OO) Modular units: objects Program structure: a graph Data and operations are bound to each other Examples: – Java, C++, Ruby A Collection of Objects A Hierarchy of Functions 4

What’s an Object? Must first define a class – A data type containing: Attributes – make up the object’s “state” Operations – define the object’s “behaviors” 5 Operations (behaviors) Type Attributes (state) String sequence of characters more? compute length concatenate test for equality more? Bank Account account number owner’s name balance interest rate more? deposit money withdraw money check balance transfer money more?

So, an Object is… A particular instance of a class 6 For any of these accounts, one can… Deposit money Withdraw money Check the balance Transfer money Bergeron’s AccountFrey’s AccountMitchell’s Account Susan Mitchell $ % Ryan Bergeron $1, % Dennis Frey $ %

Why Java for 202? Popular modern OO language Wide industry usage Used in many types of applications Desirable features – Object-oriented – Portability (cross-platform) – Easy handling of dynamic variables – Garbage collection – Built-in GUI libraries 7

Java History Created by Sun Microsystems team led by James Gosling (1991) Originally designed for programming home appliances – Difficult task because appliances are controlled by a wide variety of computer processors – Writing a compiler (translation program) for each type of appliance processor would have been very costly – Solution: two-step translation process Compile, then Interpret 8

Interpreters, Compilers, and the JVM 9 Interpreter is unique to each platform interpret source code Interpreted Languages (e.g. JavaScript, Perl, Ruby) Small, easy to write Interpreter translates code into binary and executes it compile source code Compiled Languages (e.g. C, C++) binary code execute Compiler is unique to each platform JVM is unique to each platform compile interpret source code bytecode Java Bytecode is platform independent Java Virtual Machine (JVM)

Compiling and Running C/C++ 10 C/C++ Code Linux binary Windows binary Linux executable Windows executable Project Library for Linux Project Library for Windows Linux C/C++ compiler Windows C/C++ compiler Linux C/C++ linker Windows C/C++ linker

Compiling and Running Java 11 Java Code Java Bytecode JRE for Linux JRE for Windows Java compiler Hello.java javac Hello.java Hello.class java Hello Java interpreter (JVM) translates bytecode to machine code in JRE

Java Terminology Java acronyms are plentiful and confusing. Here are the basics. – JVM – Java Virtual Machine Translates Java bytecode to machine code – API – Application Programming Interface The classes/methods/constants provided by libraries – JRE – Java Runtime Environment The JVM and the Java API together – JDK (formerly SDK) – Java Development Kit JRE + tools (compiler, debugger) for developing Java applications – Java SE – Java Platform, Standard Edition The given edition of the JRE – standard being the most common There are other versions that are tailored toward mobile devices and web environments To learn more about JDK, JRE, etc, visit: –

Java SE Versions Current version of Java: Java 7, also known as Java 1.7 or Java Previous version: Java 6, also known as Java 1.6, Java or “Java 2 SE Version 6” – This is the version running on GL servers To learn more about Java version naming, see: 13

Python vs. Java Python Java 14 print "Hello, world" quotient = 3 / 4 if quotient == 0: print "3/4 == 0", print "in Python" else: print "3/4 != 0" public class Hello { public static void main(String[] args) { int quotient; System.out.println("Hello, world"); quotient = 3 / 4; if (quotient == 0) { System.out.print("3/4 == 0"); System.out.println(" in Java"); } else { System.out.println("3/4 != 0"); } Things to note: Everything has to be in some class We need a “main()” Statements end with “;” Variables must be declared “if/else” syntax different Statement blocks demarcated by “{...}” Comments are different Much that is similar

The Eclipse IDE An integrated development environment (IDE) for writing Java programs. Contains (minimally): – Editor – Debugger – Java compiler – Java JVM Free (open source) download for Windows/Linux/Mac – See course “Resources” page on the CMSC 202 website Available in all OIT labs around campus – We’ll show you more in Lab 1 15

Eclipse IDE Screenshot 16