swap I



swap 1
Smart pascal source code
var i1 := 1; var i2 := 2; WriteLn(i1); WriteLn(i2); Swap(i1, i2); WriteLn(i1); WriteLn(i2); type TTest = class end; var o1 := TObject.Create; var o2: TObject = TTest.Create; WriteLn(o1.ClassName); WriteLn(o2.ClassName); Swap(o1, o2); WriteLn(o1.ClassName); WriteLn(o2.ClassName); {<<< RESULT - CONSOLE LOG >>> ----------------------------- 12 21 TObject TTest TTest TObject ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}