Forum: VB.NET |
Thema:
Re: kopieren zur Laufzeit ? |
Von:
G. Guest (
19.07.2005 15:12) |
Also so machen es die C# Entwickler ;-)
using System;
namespace ConsoleApplication1
{
public class App
{
[STAThread]
public static void Main(string[] args)
{
Human o = new Human();
o.field = "Init";
Human oo = (Human)o.Clone();
Console.WriteLine(oo.field.ToString());
Console.ReadLine();
}
}
public class Human : ICloneable
{
public string field;
#region ICloneable Member
public object Clone()
{
return this.MemberwiseClone();
}
#endregion
}
}
Betreff |
Von |
Datum |
|
|
Tobi
Ulm
|
19.07.2005 15:37 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!