Access the full text.
Sign up today, get DeepDyve free for 14 days.
CHAPTER 5 ■ ■ ■ Classes are the heart of any application in an object-oriented language. This chapter is broken into several sections. The first section describes the parts of C# you’ll use often, and the later sections describe features you won’t use as often, depending on what kind of code you’re writing. A Simple Class A C# class can be very simple: class VerySimple int simpleValue = 0; class Test public static void Main() VerySimple vs = new VerySimple(); This class is a container for a single integer. Because the integer is declared without speci- fying how accessible it is, it’s private to the VerySimple class and can’t be referenced outside the class. The private modifier could be specified to state this explicitly. The integer simpleValue is a member of the class; there can be many different types of members. In the Main() function, the system creates the instance in heap memory and returns a reference to the instance. A reference is simply a way to refer to an instance. There’s no need to specify when an instance is no longer needed. In the preceding example, as soon as the Main() function completes, the reference to the instance
Published: Jan 1, 2005
Read and print from thousands of top scholarly journals.
Already have an account? Log in
Bookmark this article. You can see your Bookmarks on your DeepDyve Library.
To save an article, log in first, or sign up for a DeepDyve account if you don’t already have one.
Copy and paste the desired citation format or use the link below to download a file formatted for EndNote
Access the full text.
Sign up today, get DeepDyve free for 14 days.
All DeepDyve websites use cookies to improve your online experience. They were placed on your computer when you launched this website. You can change your cookie settings through your browser.