Uses a class from Example16_3a.cs : Class Definition « Class Interface « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Class Interface » Class DefinitionScreenshots 
Uses a class from Example16_3a.cs

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/
/*
  Example16_3b.cs uses a class from Example16_3a.cs
*/

using System;
using StringSwitch;  // name space define in Example16_3c.cs

public class Example16_3b 
{

  public static void Main() 
  {
    string localString;
    MySwitch s = new MySwitch();
    s.inString="abcdef";
    s.upper(out localString);
    Console.WriteLine(localString);
  }

}

//===========================================================
/*
  Example16_3c.cs provides manifest information for Example 16_3
*/

using System.Reflection;

[assembly: AssemblyTitle("Example 16.3")]
[assembly: AssemblyVersion("1.0.0.0")]


//===========================================================
/*
  Example16_3a.cs creates a namespace with a single class
*/

using System;

namespace StringSwitch
{
  class MySwitch 
  {
    string privateString;

    public string inString 
    {
      get 
      {
        return privateString;
      }
      set
      {
        privateString = value;
      }
    }

    public void upper(out string upperString)
    {
      upperString = privateString.ToUpper();
    }

  }
}





           
       
Related examples in the same category
1.simulate a bank account
2.Using Initializers
3.A simple inventory exampleA simple inventory example
4.Declaring and Defining Classes
5.Declaring Class Instances
6.Assign value to classAssign value to class
7.Declare class and use itDeclare class and use it
8.Illustrates how to declare classes, object references, and create objectsIllustrates how to declare classes, object references, and create objects
9.Illustrates how to assign default values to fields using initializersIllustrates how to assign default values to fields using initializers
10.illustrates how to use a 'has a' relationshipillustrates how to use a 'has a' relationship
11.Illustrates nested classesIllustrates nested classes
12.Multiple constructors in a class definitionMultiple constructors in a class definition
13.Demonstrate the use of a nested class to contain dataDemonstrate the use of a nested class to contain data
14.Show name hiding in a derived classShow name hiding in a derived class
15.Illustrates hidingIllustrates hiding
16.Variable in and out a classVariable in and out a class
17.Create classCreate class
18.A program that uses the Building classA program that uses the Building class
19.This program creates two Building objectsThis program creates two Building objects
20.Return an objectReturn an object
21.A Simple C# ClassA Simple C# Class
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.