CIS 200 Test 01 Review.

Slides:



Advertisements
Similar presentations
Java Programming 2 Dr. Priti Srinivas Sajja Introductory concepts of java programming as specified in PGDCA 203:Object Technology, S P University.
Advertisements

METHOD OVERRIDING 1.Sub class can override the methods defined by the super class. 2.Overridden Methods in the sub classes should have same name, same.
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 6 Object Oriented Programming in Java Language Basics Objects.
Written by: Dr. JJ Shepherd
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
OOP Languages: Java vs C++
Overview of Previous Lesson(s) Over View  OOP  A class is a data type that you define to suit customized application requirements.  A class can be.
BASE CLASSES AND INHERITANCE CHAPTER 4. Engineer Class.
Object Oriented Concepts
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
Lecture 9 Polymorphism Richard Gesick.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
CIS 199 Test 01 Review. Computer Hardware  Central Processing Unit (CPU)  Brains  Operations performed here  Main Memory (RAM)  Scratchpad  Work.
CIS 200 Final Review. New Material Data Structures.
Introduction to Exception Handling and Defensive Programming.
C# Classes and Inheritance CNS 3260 C#.NET Software Development.
Types in programming languages1 What are types, and why do we need them?
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Copyright © 2015 Curt Hill Java for Minecraft Those things you should know.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
CIS 199 Final Review. New Material Structures  Value type  NOT a reference type!  Used to encapsulate small groups of related variables.
CIS 200 Final Review. New Material Sorting Selection Sort  Repeated scan of list for smallest/largest value  Each swap with item in correct spot 
CIS 199 Final Review. New Material Classes  Reference type  NOT a value type!  Can only inherit from ONE base class.
Introduction to Object-Oriented Programming Lesson 2.
Object-Based Programming in VB.NET. Must Understand Following: Encapsulation Information hiding Abstract Data Type Class, Instance, Reference Variable.
Classes, Interfaces and Packages
CIS 200 Test 01 Review. Built-In Types Properties  Exposed “Variables” or accessible values of an object  Can have access controlled via scope modifiers.
Written by: Dr. JJ Shepherd
1 C# - Inheritance and Polymorphism. 2 1.Inheritance 2.Implementing Inheritance in C# 3.Constructor calls in Inheritance 4.Protected Access Modifier 5.The.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
Object-Oriented Programming: Classes and Objects.
Value Types. 2 Objectives Discuss concept of value types –efficiency –memory management –value semantics –boxing –unboxing –simple types Introduce struct.
Design issues for Object-Oriented Languages
Eighth Lecture Exception Handling in Java
The Object-Oriented Thought Process Chapter 03
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
C ++ MULTIPLE CHOICE QUESTION
Andy Wang Object Oriented Programming in C++ COP 3330
CIS 199 Test 01 Review.
Introduction to LINQ and Generic Collections
Inheritance and Polymorphism
Java Primer 1: Types, Classes and Operators
Methods Attributes Method Modifiers ‘static’
Indexer AKEEL AHMED.
CIS 199 Test 01 Review.
Lecture 23 Polymorphism Richard Gesick.
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Object Based Programming
AVG 24th 2015 ADVANCED c# - part 1.
Java Programming Language
Conditional Statements
Andy Wang Object Oriented Programming in C++ COP 3330
CIS 199 Test 02 Review.
Part B – Structured Exception Handling
Java – Inheritance.
Object-Oriented Programming: Classes and Objects
Tonga Institute of Higher Education
Fundaments of Game Design
Abstract Classes and Interfaces
CIS 199 Final Review.
Introduction to Programming
CIS 199 Test 1 Review.
Classes and Objects Imran Rashid CTO at ManiWeber Technologies.
Final Exam Review Inheritance Template Functions and Classes
Jim Fawcett CSE681 – SW Modeling & Analysis Fall 2018
Exception Handling.
Presentation transcript:

CIS 200 Test 01 Review

Built-In Types

Properties Exposed “Variables” or accessible values of an object Can have access controlled via scope modifiers When thinking of properties: Values and definitions “get” – Code to run before returning a value “set” – Code to run before updating a value Can be used for validation and other processing actions “value” is a keyword in “set”

Methods Actions, code to be executed May return a value, may take value (not required) Can be controlled via scope keywords Can be static

Memory Management C, C++ - Have to “allocate” memory Forgetting to “free” results in memory leaks “Garbage Collector” Rounds up and “reclaims” memory Variables that drop out of “scope” will be collected Temporary values inside methods reclaimed on method exit Generally uncontrolled by the developer

LINQ Language Integrated Query Perform Queries Against Objects, Data

LINQ Keywords “from” - Data Source “where” – Filters the source elements with Boolean expressions “select” – Choosing the data type to work with “group” – Groups results according to a desired key value “orderby” – Sorts the query results in ascending or descending order based on a comparer “let” – Introduce a variable for query use

Preconditions Postconditions What must be TRUE before calling a method Postconditions: What will be TRUE after a method completes

Namespaces, Scope Classes, often with common functionality, bundled together System.Console System.Collections.Generic System.Linq Scope “private” – Can only be accessed by the class, object itself “protected” – Can only be accessed by the class, object, or any child classes, objects “public” – Available access for all

Constructors C#, .NET compiler provides a ‘free’ constructor No parameters When a new constructor is created, ‘free’ constructor goes away Constructors can be “connected” with “this” Can we consider having multiple constructors as method overriding?

Interfaces Object used for creating “interfaces”, common code Classes “include” an interface All methods, properties are “abstract” in an interface Objects that implement interface can be grouped List<IPayable> IPayable, IDisposable, etc

Inheritance Classes with child or children classes Can be used to “share” common code properties Allows for “unique” objects, while reducing code Object -> Person -> Student Object -> Person -> Employee

Inheritance Keywords “abstract” – Methods marked MUST be overridden Class declared with abstract prevents creation with “new” “virtual” – Methods marked CAN be overridden Controls “how” other classes inherit information from the class Private, protected, public – Used to control what is inheritance

Casting Convert one type to another Integer to String Decimal to Integer Byte to Integer C#, .NET will know how to “box” and “unbox” types Decimal -> Object -> Integer Remember back to the Person – Student relationship We can “cast” Person to Student both ways

Will cast to student just fine Will compile, But will throw an EXCEPTION at runtime

Exceptions and Exception Handling Exceptions are… “Exceptional” events Unexpected events, errors during runtime Unhandled exceptions? Stack trace and application death Handled with try/catch/finally blocks Try block “attempts” to run the code in question Catch block handles the exception(s) that may occur Finally block, optional, always executes

How can REACH further help you today? Ask Questions Now! Need to see an Example? Need to see a concept again? Need additional help? Visit us at: iTech Zone CRC (Ekstrom Library) M-Thur 8:00am – 8:00pm Friday 8:00am – 4:00pm Sunday 12:00pm – 2:00pm (CRC Only)