Lecture 20 April 13, 2000. Review for Exam All Exercises and Sample Code from Lectures Object Based Programming Object Oriented Programming String and.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 7 IO, Files, and URLs.
Advertisements

Lecture 15: I/O and Parsing
Graphical User Interfaces (Part IV)
Inner Classes. Nested Classes  An nested class is a class that is defined inside another class.  To this point we have only studied top-level classes.
CS 211 Inheritance AAA.
Slides 4/22 COP Topics Final Exam Review Final Exam The final exam is Friday, April 29 th at 10:00 AM in the usual room No notes, books, calculators,
Fall 2007CS 225 Graphical User Interfaces Event Handling Appendix C.
March 2004Object Oriented Design1 Object-Oriented Design.
Inheritance Review CSC 171 FALL 2004 LECTURE 19. READING Read Horstmann, Chapter 11 Look at Chapter 12 – Will not be on MT or Final – One lab Begin Reading.
Final Review Recitation – 05/01/2009 CS 180 Department of Computer Science, Purdue University.
Interfaces. In this class, we will cover: What an interface is Why you would use an interface Creating an interface Using an interface Cloning an object.
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 3 Object Oriented Programming in Java Language Basics Classes,
ISE 582: Web Technology for Industrial Engineering University of Southern California DJE Dept of Industrial and Systems Engineering Lecture 7 JAVA Cup.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
7/2/2015CS2621 OO Design and Programming II I/O: Reading and Writing.
Chapter 10 Classes Continued
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
ACM/JETT Workshop - August 4-5, ExceptionHandling and User Interfaces (Event Delegation, Inner classes) using Swing.
CC1007NI: Further Programming Week 8-9 Dhruba Sen Module Leader (Islington College)
Prepared by : A.Alzubair Hassan Kassala university Dept. Computer Science Lecture 2 I/O Streams 1.
CIS 644 Aug. 25, 1999 tour of Java. First … about the media lectures… we are experimenting with the media format please give feedback.
JAVA I/O © EnhanceEdu, IIIT Hyderabad. Contents 3/29/2010EnhanceEdu, IIIT - H 2  Command Line I/O  File Class  Streams  Byte Streams [Low level and.
GUIs in Java Swing, Events CS2110, SW Development Methods Readings: MSD, Chapter 12 Lab Exercise.
Chapter 8 - Additional Inheritance Concepts and Techniques1 Chapter 8 Additional Inheritance Concepts and Techniques.
CIS Intro to JAVA Lecture Notes Set June-05 GUI Programming – Assignment 5 Notes.
By Rachel Thompson and Michael Deck.  Java.io- a package for input and output  File I/O  Reads data into and out of the console  Writes and reads.
Chapter 15 Text Processing and File Input/Output Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin,
Parts of JAVA 1www.gowreeswar.com. Features of JAVA 2www.gowreeswar.com.
Data Structures Using Java1 Chapter 2 Inheritance and Exception Handling.
An Introduction to Programming and Object Oriented Design using Java 3 rd Edition. Dec 2007 Jaime Niño Frederick Hosch Chapter 18 Integrating user interface.
CS1054: Lecture 21 - Graphical User Interface. Graphical User Interfaces vs. Text User Interface.
Field Trip #22 Creating an Excel Spreadsheet with Java By Keith Lynn.
Object Oriented Programming.  Interface  Event Handling.
Chapter 14 Abstract Classes and Interfaces. Abstract Classes An abstract class extracts common features and functionality of a family of objects An abstract.
Inheritance (Part 5) Odds and ends 1. Static Methods and Inheritance  there is a significant difference between calling a static method and calling a.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
COP3502 Programming Fundamentals for CIS Majors 1 Instructor: Parisa Rashidi.
Chapter 7: Class Inheritance F Superclasses and Subclasses F Keywords: super and this F Overriding methods F The Object Class F Modifiers: protected, final.
JAVA INTRODUCTION. What is Java? 1. Java is a Pure Object – Oriented language 2. Java is developing by existing languages like C and C++. How Java Differs.
1 Exceptions Exception handling – Exception Indication of problem during execution – E.g., divide by zero – Chained exceptions Uses of exception handling.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Object Oriented Programming in Java Habib Rostami Lecture 10.
Object-Oriented Programming: Polymorphism Chapter 10.
Field Trip #34 Creating and Reading Zip Files in Java By Keith Lynn.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 10 Java Fundamentals Objects/ClassesMethods.
CSE 205 Exam 2 Review By Cheri Thompson and Katherine Kincade.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Lecture 241 CS110 Lecture 24 Thursday, April 29, 2004 Announcements –exam answers, final project (WISE) posted –final exam Thursday, May 20, 8:00 AM McCormack,
OO Design and Programming II I/O: Reading and Writing
Java Events. Java Events Important definitions Overridden method Class vs. abstract class vs. interface Event Handling Definition Main components Windows.
GUI III IS
EE2E1. JAVA Programming Revision Lecture.
University of Central Florida COP 3330 Object Oriented Programming
JAVA IO.
CHAPTER 5 (PART 2) JAVA FILE INPUT/OUTPUT
Java Programming Language
Inner Classes 29-Nov-18.
Interfaces.
Java Programming Course
Inner Classes 17-Apr-19.
Inner Classes 21-Apr-19.
Inner Classes 1-May-19.
Inner Classes 11-May-19.
Inner Classes 18-May-19.
Inner Classes.
Presentation transcript:

Lecture 20 April 13, 2000

Review for Exam All Exercises and Sample Code from Lectures Object Based Programming Object Oriented Programming String and StringBuffer Operations Input/Output Exception Management Event Management GUI Design

Object Based Programming Reference Variables Objects hold instance fields and a reference to the class object. Class objects hold static fields, pointers to both static and instance methods, and a reference to the direct superclass object. Static, instance, local, and block-local variables. Public, private, and package access.

Object Oriented Programming Class Hierarchies –The “isa” relationship –Inheritance of methods and fields Exercise 5 –The super keyword –The super() method –Protected access Classes and Interfaces –Defining vs Declaring –Abstract Classes

String and StringBuffer Operations Exercises 6a and 6b Mutable or not Relative Efficiency Methods Available

Input/Output Class java.io.File Classes for reading/writing characters –BufferedReader, FileReader –BufferedWriter, FileWriter Classes for reading/writing bytes –FileInputStream –FileOutputStream Need to close output files.

Exception Management An Exception is … –The Exception class hierarchy. –Checked/Unchecked exceptions. The throw, throws, try, catch, and finally keywords. javadoc tag.

Event Management An Event is … –Event classes Event Listener Interfaces Event Adapter Classes Callback Methods Using anonymous classes to define listener objects.

GUI Design Classes –JFrame –JMenuBar –JMenu –JMenuItem

Action Listener Strategies Simple is Better … –Separate Listeners for Each Active Component Simple: Each actionPerformed() method deals only with events from a particular component. Complex: There can be a lot of actionPerformed() methods, each with its own (anonymous) class. –One Listener for All Events Simple: Only one actionPerformed() method. Complex: The actionPerformed() method must test each ActionEvent to see which component it came from, and then branch to the appropriate code for that component. [ ActionListener_ex.java ]ActionListener_ex.java