Textbook Notes (369,056)
United States (206,174)
Music (2)
MUSIC 007 (2)
Cornella (2)
Chapter 5

c# CHapter 5 notes.docx

3 Pages
94 Views

Department
Music
Course Code
MUSIC 007
Professor
Cornella

This preview shows page 1. Sign up to view the full 3 pages of the document.
Description
• C# is inherently an object – oriented language • Console is an object. • Objects are everyone. • Program are a collection of objects, they can communicate with each other and the program. • Class – Most common types of c# o Provides a blueprint, or a description of what an object looks like. o What kinds of data an object of this type holds o A class is not, however, the actual object itself. o Classes are provided by .NET framework. An can define our own. o Classes essentially define two major things ( called members) o Field and Properties – what kinds of data the object holds and work with o Methods – What the object can do – what its functionality is. o Classes can inherit attributes and methods from other classes. o Subclasses Class B: A from Class A o Class A is called the Super Class. o Instances – Used to create individual objects. o Why use classes?  Helps abtracts ideas away from a specific implementation  Allows you to focus on the core parts of the program.  Also helps Encapsulate program functionality into understandable pieces  All have related data and logic are all kept in one place.  Helps organizes a program into natural parts that can be extended  Sometimes referred to as factoring  Create programs that mirror real world constructs and ideas.  Object. o How to define a Class  Used the class keyword.  Use the class, then say new myClass //calls constructor.  To use methods, use the “.” Dot operator.  Static members don’t require instantion to use them.  Instance members, get copied each time a new object is created  Static members belong to the entire class – there is only one o Class access Modifiers.  You can only use the data in that class and you can choose to expose them
More Less
Unlock Document

Only page 1 are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit