Learning Plan 6 Java Programming Intro to Object Oriented Programming.

Slides:



Advertisements
Similar presentations
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Advertisements

Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Object Orientated Programming
IC211 Object Oriented Programming Overview of Java.
Introduction to Programming with Java “Object Oriented” Programming Compiling & Running Java Programs.
Introduction to Java Programming, 4E
Applying OO Concepts Using Java. In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
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.
Programming Languages and Paradigms Object-Oriented Programming.
220 FINAL TEST REVIEW SESSION Omar Abdelwahab. INHERITANCE AND POLYMORPHISM Suppose you have a class FunClass with public methods show, tell, and smile.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
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.
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.
1.  At the end of this slide, student can:  Explore tools, features, properties and interface of the Textpad.  Creating a new project.  Open and run.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
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.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
1 CSC204 – Programming I Lecture 2 Intro to OOP with Java.
Your First Java Application Chapter 2. 2 Program Concepts Modern object-oriented programs help us build models to manage the complexity found in a problem.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Programs.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Programming Concept Chapter I Introduction to Java Programming.
Week 1 - Friday.  What did we talk about last time?  Our first Java program.
Introduction to Java Programming with Forte Y. Daniel Liang.
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
OOP and Dynamic Method Binding Chapter 9. Object Oriented Programming Skipping most of this chapter Focus on 9.4, Dynamic method binding – Polymorphism.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
 Instructor: Dr. Jason Nichols –  Office Hours: – 9:30-10:30 M/W/F or by appointment – Business Building.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Pengantar OOP Class-Java. 2 Software Development Tools Using Sun Java SDK alone Source File(s) (.java) Programmer Compiler (javac) Class File(s) (.class)
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
Object-Oriented Programming. Objectives Distinguish between object-oriented and procedure-oriented design. Define the terms class and object. Distinguish.
CSI 3125, Preliminaries, page 1 Compiling the Program.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
CET 3640 Instructor: Dr. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
OOP Basics Classes & Methods (c) IDMS/SQL News
Chapter 1 Object Orientation: Objects and Classes.
Chapter 12: Support for Object- Oriented Programming Lecture # 18.
Introduction to Java Programming, 4E Y. Daniel Liang.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Chapter 1 Introduction to Computers, Programs, and Java
Lecture 1 Runtime environments.
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Introduction to Java Dept. Business Computing University of Winnipeg
OOP’S Concepts in C#.Net
Getting Started ARCS Lab..
Inheritance Basics Programming with Inheritance
Your First Java Application
Chapter 3 Classes and Objects
Chapter 1 Introduction to Computers, Programs, and Java
Computer Programming with JAVA
Applying OO Concepts Using Java
Lecture 1 Runtime environments.
Chapter 2: Java Fundamentals
Road to Object Oriented Programming
Presentation transcript:

Learning Plan 6 Java Programming Intro to Object Oriented Programming

Object Oriented Programming (OOP) Up until this point, all of our programs contained one class (Furniture, Admissions, etc.) For example: public class HelloWorld { public static void main(String[] args) { System.out.println(“HelloWorld”); }

public class HelloWorld { public static void main(String[] args) { System.out.println(“HelloWorld”); } Our programs contained one class Each class (or each program) contained a main method We are now going to start adding additional classes to our programs Our programs will contain more than one class Only one of the classes will contain a ‘main’ method …. The rest do not.

Object Oriented Programming We are going to explore the OOP concept We’ve already been using it OOP allows for reusability of code – Why reinvent the wheel? Consider the following code:

Object-Oriented Programming (OOP) JOptionPane.showInputDialog(null, “Enter Name”): We’ve used this code frequently There is a file called JOptionPane.java that has been written and compiled for us (it became JOptionPane.class) Every time we wanted to ask the user for input, we REUSED the code from the JOptionPane class

Object Oriented Programming Start with Head First Java book Might jump around slightly Basic OOP Concepts and more advanced concepts – We will discuss & use basic concepts in depth – We will discuss and analyze advanced OOP concepts but use more of the concepts in other courses.

OOP Basic concepts include: – Classes, objects, methods, instance variables/properties, arguments, parameters, instantiation, encapsulation Advanced Concepts: – Inheritance superclass/subclass, overriding methods, polymorphism, abstract classes, interfaces Chapter 1 – read 2-3; 8-17

Before you start – Page 2 talks about the Java Virtual Machine (JVM) Java is a “write once, run anywhere” programming language. – Allows programs to run on multiple devices – Page 3 shows you that to compile a program, you execute the ‘javac’ command and to run it you start the JVM and execute the ‘java’ command Textpad does this automatically for us!!