C# Exception MemberwiseClone

In this chapter you will learn:

  1. Get to know Exception.MemberwiseClone
  2. Syntax for Exception.MemberwiseClone
  3. Returns for Exception.MemberwiseClone
  4. Example - Exception.MemberwiseClone

Description

Exception MemberwiseClone creates a shallow copy of the current Object.

Syntax

Exception.MemberwiseClone has the following syntax.


protected Object MemberwiseClone()

Returns

Exception.MemberwiseClone method returns A shallow copy of the current Object.

Example


using System;/*from   w w w  . j  a  va2 s  . co  m*/
public class MainClass{
  public static void Main(String[] argv){  
    Exception e = new Exception("asdf")
    Exception e1 = e.MemberwiseClone()
    
    System.Console.WriteLine(e.Equals(e1));
  }
}

Next chapter...

What you will learn in the next chapter:

  1. Get to know Exception.ToString
  2. Syntax for Exception.ToString
  3. Returns for Exception.ToString
  4. Example - Exception.ToString
Home »
  C# Tutorial »
    System »
      Exception
C# Exception Data
C# Exception HelpLink
C# Exception InnerException
C# Exception Message
C# Exception Source
C# Exception StackTrace
C# Exception TargetSite
C# Exception Exception()
C# Exception Exception(String)
C# Exception Exception(String, Exception)
C# Exception Equals(Object)
C# Exception Finalize
C# Exception GetBaseException
C# Exception GetHashCode
C# Exception GetType
C# Exception MemberwiseClone
C# Exception ToString