Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Designing a Program & the Java Programming Language
In Review JAVA C++ GUIs - Windows Webopedia.com.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Object Oriented Programming in Java George Mason University Fall 2011
1 Chapter 6: Extending classes and Inheritance. 2 Basics of Inheritance One of the basic objectives of Inheritance is code reuse If you want to extend.
Lab#1 (14/3/1431h) Introduction To java programming cs425
April 20023CSG11 Electronic Commerce Java (1) John Wordsworth Department of Computer Science The University of Reading Room 129,
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
JVM-1 Java Virtual Machine Reading Assignment: Chapter 1: All Chapter 3: Sections.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 16 Applets.
Introduction to Java CS 331. Introduction Present the syntax of Java Introduce the Java API Demonstrate how to build –stand-alone Java programs –Java.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
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.
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,
Rina System development with Java Instructors: Rina Zviel-Girshin Interdiciplinary Center Herzlia School of the Computer Science Fall:
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
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.
POS 406 Java Technology And Beginning Java Code
Java Programming, Second Edition Chapter One Creating Your First Java Program.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Intro to Applets August 19, 2008 Mrs. C. Furman. Java Applets vs. Java Applications Java Applet: a program that is intended for use on the web. Java Applet:
More on Hierarchies 1. When an object of a subclass is instantiated, is memory allocated for only the data members of the subclass or also for the members.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
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.
Applets Yong Choi School of Business CSU, Bakersfield.
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.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
CSE 341, S. Tanimoto Java brief review - 1 Java Brief Review Java’s strengths Object-oriented terminology Inheritance Interfaces An example with inheritance.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Your name CSCI/CMPE 3326 Object-Oriented Programming in Java Dongchul Kim Department of Computer Science University of Texas – Pan American 1.Applet.
1 Applications & Applets Standalone applications & Java applets Peter Mozelius DSV/UCSC.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Creating a Java Application and Applet
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.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
COP INTERMEDIATE JAVA Inheritance, Polymorphism, Interfaces.
Creating Java Applications (Software Development Life Cycle) 1. specify the problem requirements - clarify 2. analyze the problem - Input? Processes? Output.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Lesson 2: First Java Programs. 2.1 Why Java? Java is one of the most popular programming languages in the world. Java is a modern object-oriented programming.
Learning Plan 6 Java Programming Intro to Object Oriented Programming.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
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.
Electronic Commerce Java (1)
Applications Active Web Documents Active Web Documents.
Introduction to.
Text by: Lambert and Osborne
Internet and Java Foundations, Programming and Practice
Programming Language Concepts (CIS 635)
Java Applets.
Constructors, GUI’s(Using Swing) and ActionListner
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
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:

Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code

Def. Class - a coded computer entity that defines the attributes of an object, including data fields and methods for operating on that data. Def. Object - a computer entity that is created during the execution of a program and is an instance of a class, thereby possessing all of the attributes described in that class. Note: many instances of the same class may be instantiated.

Classes can be extended 1. a subclass can be created which inherits all attributes from another class (its parent) or any other superclass that came before it. 2. The subclass can add its own methods and data fields. Ex. Java provides the package called swing which has a large hierarchy of classes for creating graphical user interfaces.

Two type of Java programs: 1. applications - run alone like traditional programs 2. applets - may be used as part of a web page and require an HyperTextMarkupLanguage file which is run by a web browser or appletviewer program.

Java Applications An application is a Java program that usually consists of two parts: a client class support classes. The steps in writing a Java application are: 1. Solve the problem by hand. 2. Design Java classes to solve the problem. 3. Write code for the classes and enter it using any text editor. 4. Compile the classes by entering javac ClientClass.java 5. Run the application by entering java ClientClass

//Your name, date, course goes here. //Purpose of the application here. import javax.swing.* ; public class MyFirstClientClass { public static void main(String [] args) { SupportClass myClass = new SupportClass(); myClass.doSomething(); }//end main method }//end class

//Your name, date, course and purpose of the application goes here. import javax.swing.* ; public class SupportClass { //data members go here //default constructor public Supportclass() {} //methods public void doSomething( ) { //statements go here} }//end class

Applets 1. Small Java programs designed to be part of a web page. 2. May reside on any computer attached to the Internet and may be run on any other computer (of any platform) using a program called a Web browser. 3. May also be run on the same computer on which it resides using a program called an appletviewer (which comes with the Java Virtual Machine)..

4. The same object code (byte code) is sent to any user requesting it. The JVM on the user’s computer acts as an interpreter for the user’s particular computer.