Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Similar documents
Introduction to Programming Using Java (98-388)

1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4. Epic Test Review 5 Epic Test Review 6 Epic Test Review 7 Epic Test Review 8

F1 A Java program. Ch 1 in PPIJ. Introduction to the course. The computer and its workings The algorithm concept

Exam 1 Prep. Dr. Demetrios Glinos University of Central Florida. COP3330 Object Oriented Programming

COP 3330 Final Exam Review

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Java Fundamentals p. 1 The Origins of Java p. 2 How Java Relates to C and C++ p. 3 How Java Relates to C# p. 4 Java's Contribution to the Internet p.

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

2. The object-oriented paradigm!

This page intentionally left blank

CMSC131. Inheritance. Object. When we talked about Object, I mentioned that all Java classes are "built" on top of that.

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs.

Object Oriented Programming. Java-Lecture 11 Polymorphism

Murach s Beginning Java with Eclipse

CompuScholar, Inc. 9th - 12th grades

WA1278 Introduction to Java Using Eclipse

Index COPYRIGHTED MATERIAL

15CS45 : OBJECT ORIENTED CONCEPTS

TeenCoder : Java Programming (ISBN )

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

Absolute C++ Walter Savitch

Array. Prepared By - Rifat Shahriyar

Declarations and Access Control SCJP tips


Review sheet for Final Exam (List of objectives for this course)

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Java Object Oriented Design. CSC207 Fall 2014

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Short Notes of CS201

CS201 - Introduction to Programming Glossary By

CO Java SE 8: Fundamentals

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Java Programming Training for Experienced Programmers (5 Days)

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical

Big Java Late Objects

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Lecture 36: Cloning. Last time: Today: 1. Object 2. Polymorphism and abstract methods 3. Upcasting / downcasting

This page intentionally left blank

CS260 Intro to Java & Android 03.Java Language Basics

Java SE7 Fundamentals

About this exam review

1 Shyam sir JAVA Notes

Inheritance. Transitivity

College Board. AP CS A Labs Magpie, Elevens, and Picture Lab. New York: College Entrance Examination Board, 2013.

CORE JAVA TRAINING COURSE CONTENT

CMSC131 Final Exam Practice Questions

Java Programming with Eclipse

CSE 401/M501 Compilers

CSC207H: Software Design. Java + OOP. CSC207 Winter 2018


Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Java 1.8 Programming

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

MyProgram m i ng Lab. get with the programming. Through the power of practice and immediate personalized

CS 251 Intermediate Programming Methods and Classes

CS 251 Intermediate Programming Methods and More

Java: introduction to object-oriented features

C++ Important Questions with Answers

CS250 Final Review Questions

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p.

Contents Chapter 1 Introduction to Programming and the Java Language

+ Abstract Data Types

C11: Garbage Collection and Constructors

Objects and Iterators

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

Pace University. Fundamental Concepts of CS121 1

CS250 Final Review Questions

JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015

OBJECT ORİENTATİON ENCAPSULATİON

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

CS Internet programming Unit- I Part - A 1 Define Java. 2. What is a Class? 3. What is an Object? 4. What is an Instance?

CGS 2405 Advanced Programming with C++ Course Justification

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1

Standard. Number of Correlations

Chapter 11 Inheritance and Polymorphism. Motivations. Suppose you will define classes to model circles,

Java Fundamentals (II)

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

JAVA MOCK TEST JAVA MOCK TEST II

CPS 506 Comparative Programming Languages. Programming Language

Topics Covered Thus Far. CMSC 330: Organization of Programming Languages. Language Features Covered Thus Far. Programming Languages Revisited

Practice for Chapter 11

C10: Garbage Collection and Constructors

Java Magistère BFA

CERTIFICATE IN WEB PROGRAMMING

CS 231 Data Structures and Algorithms, Fall 2016

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

Page 1

Inheritance and Polymorphism

Administrivia. Java Review. Objects and Variables. Demo. Example. Example: Assignments

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

VALLIAMMAI ENGINEERING COLLEGE

CMSC 330: Organization of Programming Languages

Prelim 1 SOLUTION. CS 2110, September 29, 2016, 7:30 PM Total Question Name Loop invariants. Recursion OO Short answer

Chapter 6 Introduction to Defining Classes

Tentative Teaching Plan Department of Software Engineering Name of Teacher Dr. Naeem Ahmed Mahoto Course Name Computer Programming

Transcription:

CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java was the primary vehicle we used for programming. This will continue in CMSC 132 where you will learn more of the finer points of objectoriented design. Major Topics: Basic Elements: types, variables, constants, operators, I/O Control Flow: if-else, switch, while, do-while, for Classes: object instances and references instance and class data methods Arrays: 1-dim, multi-dim, ragged arrays, programming Inheritance: overriding, late-binding, interfaces Basic Elements (of Java) Basic Elements: Basic file structure: File name, class structure, comments Identifiers: Naming rules and naming conventions. Primitive types: boolean Integral types: byte, (char), short, int, long Floating point types: float, double Strings: and common String operators/methods. Specifying constants: true, x, 12, 3124L, 3.14159e-10 Operators: Their meaning and precedence rules. Are these valid identifier names? $_Pasta_Fazool_22 Operator precedence: x * 2 + y -- Is a cast needed? float y = 2.0;

Control Flow Control flow: Conditionals: if-else, switch Loops: while, do-while, for Jumps: break and continue Trace the loop: for ( int i = 4; i < 10; i += 3 ) { Combining loops and conditionals: Is a string a palindrome? Combining loops with arrays: Insert an item into a sorted array. Nested conditionals: Given x, y, and z, return the smallest. Nested loops: Selection, Insertion, Bubble Sort. Don t forget breaks in switch statements. Be sure you understand the problem before coding. (If not, ask) Test on a example before and after coding. Classes Class Objects and References: Creating object instances with new The null reference Java s class library The heap and garbage collection Basic Class Concepts: Instance (non-static) and class (static) variables Access modifiers (public, private, protected, default (package)) Constructors (initializers) Methods: Static and non-static Arguments, call-return, and local variables Return and memory leaks

Classes Draw a memory map You be the compiler: We declare methods and create some objects, and ask you which overloaded method is called, or ask you whether access is valid/invalid Class design: we specify the objects and functionality you design the class: instance variables, constructors, methods Call the right method: Determine which overloaded function to call, then check its accessibility. Read your old programs: Eclipse fills in many things for you automatically. Be sure you can do it on your own. Deep/Shallow copy: For a deep copy, create new object instances. Memory Map Example public class Person { private String name; private int age; public Person( String n, int a ) { name = n; age = a; static void f( String b ) { int x = b.length( ); /* STOP HERE */ public static void main( String[ ] args ) { String[ ] n = {"Bob", "Alice"; Person p = new Person( n[1], 43 ); f( n[0] );

Heap main x: f b: p: n: 3 4 Bob call stack Alice Arrays: Arrays Creating, indexing Arrays of primitives and object references 2-dimensional arrays and ragged arrays (array of arrays) Array manipulation: Inserting/Removal/Searching in partially filled arrays Appending/Merging arrays Shifting, rotating, permuting elements in an array 2-dim array manipulation: Appending arrays Transposing arrays (inverting rows and columns) Allocation: Remember to explicitly allocate array/element storage Simplify: Break complex operations into smaller/simpler pieces Inside-Out: Design nested loops from the inside-out

Inheritance Inheritance: Terminology: base class (superclass), derived class (subclass), super (parent class) Method overriding (vs. overloading), late-binding, and final Abstract methods and abstract classes (derived class implements) and polymorphism up- and down-casting, getclass and instanceof Multiple inheritance and interfaces Be the compiler: We give code. Which method is called? Design: We give the specs, you design the classes and methods. Overriding only occurs when prototypes are identical. Start at the declared class, and go to the derived class if overriding applies. Miscellaneous Miscellaneous Topics: Javadoc: @tags and their usage: @author, @param, @returns, Java Class Library: Math, DecimalFormat, ArrayList, Packages: Organizes Java files into groups (directories) Packages may be subdivided into subpackages You have access to names in your own package or packages you import. Exceptions: try-catch blocks and exception propagation Know common methods for String and ArrayList. For others know the basic concepts (Stack: push, pop, peek) but not details. Package: What is accessible with/without importing? Exception: Design/trace try-catch blocks.

What s Coming Up? CMSC 132: You will learn more about object oriented programming in greater depth, still in Java. More on software testing (JUnit) and debugging I/O and exceptions Recursive functions Linked data structures Networking CMSC 212: Low-level programming concepts C programming Memory allocation and deallocation Internal representations of arrays and data structures CMSC 250, 351: Discrete math and algorithm design CMSC 311: Computer organization ( what s inside ) CMSC 330: Programming languages