CIS 200 Test 01 Review - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

CIS 200 Test 01 Review

Description:

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 ... – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0
Slides: 27
Provided by: PeterU154
Category:

less

Transcript and Presenter's Notes

Title: CIS 200 Test 01 Review


1
CIS 200 Test 01 Review
2
Built-In Types
3
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

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

6
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

7
LINQLanguage Integrated Query
  • Perform Queries Against Objects, Data

8
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

9
(No Transcript)
10
PreconditionsPostconditions
  • Preconditions
  • What must be TRUE before calling a method
  • Postconditions
  • What will be TRUE after a method completes

11
(No Transcript)
12
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

13
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

14
(No Transcript)
15
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
  • ListltIPayablegt
  • IPayable, IDisposable, etc

16
(No Transcript)
17
Inheritance
  • Classes with child or children classes
  • Can be used to share common code properties
  • Allows for unique objects, while reducing code
  • Object -gt Person -gt Student
  • Object -gt Person -gt Employee

18
InheritanceKeywords
  • 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

19
(No Transcript)
20
(No Transcript)
21
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 -gt Object -gt Integer
  • Remember back to the Person Student
    relationship
  • We can cast Person to Student both ways

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

24
(No Transcript)
25
(No Transcript)
26
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 800am 800pm
  • Friday 800am 400pm
  • Sunday 1200pm 200pm(CRC Only)
Write a Comment
User Comments (0)
About PowerShow.com