Introduction to Programming with Java “Object Oriented” Programming Compiling & Running Java Programs.

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
C++ Language Fundamentals. 2 Contents 1. Introduction to C++ 2. Basic syntax rules 3. Declaring and using variables.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Classes & Objects Computer Science I Last updated 9/30/10.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Introduction to Computers and Java Recitation - 01/11/2008 CS 180 Department of Computer Science, Purdue University.
Introduction to Programming with Java, for Beginners Welcome.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
9-Aug-15 Vocabulary. Programming Vocabulary Watch closely, you might even want to take some notes. There’s a short quiz at the end of this presentation!
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Chapter 1 Coding Introduction.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
Introduction to Object-oriented programming and software development Lecture 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Welcome to OBJECT ORIENTED PROGRAMMIN Date: 10/09/2014 Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
O BJECT O RIENTATION F UNDAMENTALS Prepared by: Gunjan Chhabra.
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.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
Introduction to C++ Programming Language
Java Programming, Second Edition Chapter One Creating Your First Java Program.
SNPL1 Woochang Lim What (Variable) + How (Function) = Object Objects are the physical and conceptual things we find in the universe around us. Object-Oriented.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Chapter 12 Support for Object oriented Programming.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
1.
Java Fundamentals Usman Ependi UBD
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
Introduction to OOP CPS235: Introduction.
Programming Languages Notes Software Design & Development: Languages & environments, Low level operations and computer architecture.
Classes, Interfaces and Packages
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Learning Plan 6 Java Programming Intro to Object Oriented Programming.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
CIS 234: Object-Oriented Programming with Java
Chapter 1 Coding Introduction.
Programming paradigms
Programming Paradigms
Visit for more Learning Resources
Object Oriented Programming
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Before You Begin Nahla Abuel-ola /WIT.
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Sections Basic Concepts of Programming
Key Ideas from day 1 slides
Lecture 1: Introduction to JAVA
OOP What is problem? Solution? OOP
Introduction Enosis Learning.
Object-Orientated Programming
Chapter 1 FOUNDATIONS OF JAVA
Teaching Computing to GCSE
Introduction Enosis Learning.
Chapter 1 Coding Introduction.
Your First Java Application
Basic Object Oriented Approach
The Programming Process
Java History, Editions, Version Features
Programming Paradigms
Presentation transcript:

Introduction to Programming with Java “Object Oriented” Programming Compiling & Running Java Programs

1 Computing in the world We live in a complicated world. Computing is how we deal with it Search billions of Web pages Manage air traffic Automate investment trading Computer animation and games Create accurate body images for surgery Share media data Stay in touch with our friends

2 Coping in a computing world Modularity Break big problems into simpler sub-problems Solve big problems by composing the solutions of the sub-problems Abstraction Find common features and express solutions in terms of those features

3 Software Design Considerations How can I break this complicated system/simulation/game in to manageable pieces? How can I make the code reliable (according to spec) How can I make the code easy to Test and debug Add more (potentially unforseen) pieces (ideally by reusing some of the code we’ve already written) Accomplish inevitable design changes by rewriting as few of those pieces as possible Use existing code that’s already been debugged

4 Object Oriented Programming A program (written in an OOP language) is a collection of cooperating objects An object has: 1. state: data stored in fields (instance variables) 2. methods: named blocks of code that determine how an object behaves (also known as procedures/functions) A class is a template for creating objects An object is an instance of a class

5 Example: Ghost name x y … getX() getY() move() … data behavior

6 One Ghost Class Multiple Ghost Objects name x y getX() … “Inky” getX() … “Blinky” 40 6 getX() … “Pinky” 9 68 getX() … “Clyde” getX() …

7 Methods: Questions, Commands Query Methods: ask an object about its state // ask a Ghost for its x position ghost1.getX() ghost2.getX() Command Methods: change an object’s state // move a Ghost forward ghost1.move()

8 Program: Cooperating Objects 3D Scene One Light class, multiple Light objects One Camera class, multiple Camera objects, … Lord of the Rings Simulation One 3D Scene class, one 3D Scene object One Elf class, many Elf objects One Orc class, many Orc objects Financial Software One Trade class, multiple Trade objects (buy/sell/etc) One Trader class, multiple Trader objects (human/auto)

9 OOP Concepts Encapsulation Data, and the methods that operate on it, are grouped in an object. An object’s data (“state”) can/should be protected by making it read/writeable only via its methods (“information hiding”) Inheritance Write code once in class A and reuse it many times in subclasses B, C, and D. We call A a superclass/supertype and B, C, D subclasses/subtypes. Polymorphism Code can take on “many forms”. This is accomplished via supertype-subtype relationships established via inheritance and interfaces. (Also with generics in Java 1.5+.) Abstraction We can write code that “ignores the details”.

10 Programming Languages Unlike human languages: Designed for instructing computers to solve problems The listener (the compiler) is exacting & unforgiving (grr!) Like human languages they have a grammar that has evolved A Sketch of Java’s Evolution: Machine language: (code of 1’s and 0’s) Assembly language: (e.g. add, sub, jmp) C (more English-like, procedural, pointers) C++ (loosely object oriented with multiple inheritance) Java / C# (purely object oriented with single inheritance, strongly typed, garbage collection, no pointers) Evolutionary trend: more modularity and abstraction

11 Java Compiler and Virtual Machine The Java Compiler Checks syntax / grammar Creates a.class file which contains byte code (virtual machine code) Java Byte Code Is portable The JVM Translates byte code in to instructions for a particular processor, which “runs the program”