C# Uri MemberwiseClone

In this chapter you will learn:

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

Description

Uri MemberwiseClone creates a shallow copy of the current Object.

Syntax

Uri.MemberwiseClone has the following syntax.


protected Object MemberwiseClone()

Returns

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

Example


using System;//from w w  w . j  ava 2  s.  co m
public class MainClass{
  public static void Main(String[] argv){  
    // Create a base Uri.
    Uri address1 = new Uri("http://www.java2s.com/");
    
    // Create a new Uri from a string.
    Uri address2 = address1.MemberwiseClone(); 
    
  }
}

Next chapter...

What you will learn in the next chapter:

  1. Get to know Uri.Parse
  2. Syntax for Uri.Parse
  3. Returns for Uri.Parse