CIS 200 Test 01 Review. Built-In Types Properties  Exposed “Variables” or accessible values of an object  Can have access controlled via scope modifiers.

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

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
CERTIFICATION OBJECTIVES Use Class Members Develop Wrapper Code & Autoboxing Code Determine the Effects of Passing Variables into Methods Recognize when.
Introduction to Programming Lesson 1. Objectives Skills/ConceptsMTA Exam Objectives Understanding Computer Programming Understand computer storage and.
CS 211 Inheritance AAA.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
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.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
OOP Languages: Java vs C++
To define a class in Visual Basic.NET, you can follow this general procedure: 1. Add a class to the project. 2. Provide an appropriate file name for.
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.
220 FINAL TEST REVIEW SESSION Omar Abdelwahab. INHERITANCE AND POLYMORPHISM Suppose you have a class FunClass with public methods show, tell, and smile.
BASE CLASSES AND INHERITANCE CHAPTER 4. Engineer Class.
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.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
Introduction to Exception Handling and Defensive Programming.
Object Based Programming Chapter 8. 2 In This Chapter We will learn about classes Garbage Collection Data Abstraction and encapsulation.
Page: 1 การโปรแกรมเชิงวัตถุด้วยภาษา JAVA บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 15 มิถุนายน 2552 Keyword & Data Type มหาวิทยาลัยเนชั่น.
Exceptions, cont’d. Factory Design Pattern COMP 401 Fall 2014 Lecture 12 9/30/2014.
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 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 26 - Java Object-Based Programming Outline 26.1Introduction.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
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 
1 The finalize, clone, and getClass Methods  The finalize method is invoked by the garbage collector on an object when the object becomes garbage.  The.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
CIS 199 Final Review. New Material Classes  Reference type  NOT a value type!  Can only inherit from ONE base class.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Object-Based Programming in VB.NET. Must Understand Following: Encapsulation Information hiding Abstract Data Type Class, Instance, Reference Variable.
Classes, Interfaces and Packages
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Written by: Dr. JJ Shepherd
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
Presented by Ted Higgins, SQL Server DBA An Introduction to Object – Oriented Programming.
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 –
Introduction to Exceptions in Java CS201, SW Development Methods.
Introduction to Programming Lesson 1. Algorithms Algorithm refers to a method for solving problems. Common techniques for representing an algorithms:
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
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.
CIS 199 Test 01 Review.
CIS 200 Test 01 Review.
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
Java Programming Language
Conditional Statements
CIS 199 Test 02 Review.
CIS 199 Final Review.
Introduction to Programming
CIS 199 Test 1 Review.
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  Preconditions:  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”

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, 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 compile, But will throw an EXCEPTION at runtime Will cast to student just fine

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)