Learning C# and OOP Classes Los Angeles CA

This is the second lesson in a miniseries designed to teach you how to write object-oriented programs using C#. This miniseries will describe and discuss the necessary and significant aspects of object-oriented programming (OOP) using C#.

Local Companies

Moyea Software
92295612365
Hot building, ring street
LA, CA
Interneer Inc.
8005586832 x85
6101 W. Centinela Ave.
Culver City, CA
Cornerstone Concepts Inc
818-247-3909
600 W Broadway
Glendale, CA
Greene Computer Corporation
(818) 956-4961
200 S. Louise Street
Glendale, CA
Corticalx Inc Software Solutions & Technology
818-500-0881
425 E Colorado St
Glendale, CA
Alphatier Systems
818-409-8920
517 Griswold St
Glendale, CA
TimeTECH - Customizable Time and Attendance / Workforce Management Solutions
905-677-7009
7420 Airport Rd 203
Mississauga, CA
Hutchinson & Bloodgood, LLP
(818) 637-5000
101 N. Brand Blvd. #1600
Glendale, CA
Telsoft Solutions
818-545-8680
100 N Brand Blvd
Glendale, CA
Abraxas Technologies Inc
818-502-9100
450 N Brand Blvd
Glendale, CA

provided by: 
Originally published at Internet.com


C# Programming Notes # 104 * Preface * Preview * Discussion and Sample Code * Summary * What's Next * Complete Program Listings * Review Questions * Answers -----------------------------------

Preface

This is the second lesson in a miniseries designed to teach you how to write object-oriented programs using C#. This miniseries will describe and discuss the necessary and significant aspects of object-oriented programming (OOP) using C#.

The first lesson in the miniseries was entitled Learning C# and OOP: Getting Started, Objects and Encapsulation.

Comparisons with Java

The miniseries will also make comparisons between C# and Java with respect to both syntax and OOP concepts. I will emphasize the similarities between these two programming environments, which are likely to dominate the programming world in the foreseeable future. By studying these lessons and learning about OOP using C#, you will also be learning quite a lot about OOP using Java.

Relatively high level

I will provide the information in a high-level format, devoid of any prerequisite requirement to know C# syntax. In those cases where an understanding of C# syntax is required, I will provide the necessary syntax information in the form of sidebars and sample programs.

Therefore, if you have a general understanding of computer programming, you should be able to read and understand the lessons in this miniseries, even if you don't have a background in object-oriented programming, or a background in the C# programming language.

Viewing tip

You may find it useful to open another copy of this lesson in a separate browser window. That will make it easier for you to scroll back and forth among the different listings while you are reading about them.

Supplementary material

I recommend that you also study the other lessons in my extensive collection of online programming tutorials. You will find those lessons published at developer.com. However, as of the date of this writing, developer.com doesn't maintain a consolidated index of my tutorial lessons, and sometimes they are difficult to locate there. You will find a consolidated index at www.DickBaldwin.com.

Preview

Concentrate on classes

This lesson will concentrate primarily on a discussion of the C# class, and a coomparison of a C# class with a similar Java class.

A simple C# program will be developed to illustrate the definition and use of two different classes. Taken in combination, these two classes simulate the manufacture and use of the car radio object discussed in the previous lesson.

Instance variables and instance methods

You will see the definition of a C# class named Radio. This class includes one instance variable and two instance methods. (The instance variable is a reference variable that refers to a special kind of object that I call an array object. I will provide a very brief discussion of array objects in this lesson. I will have more to say about array objects in a future lesson.)

Creating a new object

You will learn how to write code to create a new Radio object by applying the new operator to the constructor for a C# class named Radio. You will also learn how to save that object's reference in a reference variable of type Radio.

Defining methods

You will learn how to write C# code that is used to simulate the association of a radio button with a particular radio station.

You will learn how to write C# code that is used to simulate the pressing of a radio button to play the radio station associated with that button.

The Main method

You will see the definition of a C# class named Radio01. This class consists simply of the Main method. You will learn that the Main method of a C# program is executed by the C# Common Language Runtime (CLR) when the program is run. Thus, the Main method is the driver for the entire program.

Comparison with Java code

In addition, you will learn how to write Java code to perform the tasks described above. You will learn about the similarities and differences between the C# code and the Java code. You will learn that at this level, there is very little difference between C# and Java.

Static variables

I will provide a short discussion of static variables, which are not used in this program. I will explain that the use of static variables can often lead to undesirable side effects.

General class-definition syntax

Finally, I will provide a very brief discussion of the general syntax of a simple class definition in C#.

Discussion and Sample Code

What is a class?

A class is a plan from which many objects can be created. In an earlier lesson, I likened the class definition to the plans from which millions of nearly identical car radios can be manufactured.

A simple C# program

In this lesson, I will provide and discuss a simple C# program. This will help to get you started on the right foot. I will also compare this simple C# program with a Java program designed to accomplish the same purpose. This will illustrate the similarity of these two programming environments.

The complete C# program is shown in Listing 11, near the end of the lesson. This program simulates the manufacture and use of a car radio. The complete Java program is shown in Listing 12 near the end of the lesson.

Explain in fragments

In order to help you to focus specifically on important sections of code, I will explain the behavior of this program in fragments.

Top-level classes

This program contains two top-level class

Author: Richard G. Baldwin

Read article at Internet.com site

Featured Local Company

Moyea Software

92295612365
Hot building, ring street
LA, CA

Related Local Events
Automation Technology Expo West (ATX West)
Dates: 2/9/2010 - 2/11/2010
Location: Anaheim Convention Center
Anaheim, CA
View Details

SOLAR POWER - Exhibition and Conference
Dates: 10/12/2010 - 10/14/2010
Location: Los Angeles Convention & Exhibition Center
Los Angeles, CA
View Details

REAL-TIME & EMBEDDED COMPUTING CONFERENCE - LONG BEACH 2009
Dates: 10/1/2009 - 10/1/2009
Location: Marriott Long Beach
Long Beach, CA
View Details

2009 IEEE Petroleum and Chemical Industry Technical Conference (PCIC 2009)
Dates: 9/14/2009 - 9/16/2009
Location:
Anaheim, CA
View Details

Medical Design & Manufacturing - Trade
Dates: 6/9/2009 - 6/11/2009
Location: CANON COMMUNICATIONS LLC
Los Angeles, CA
View Details