User Tools

Site Tools


method_overloading

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
method_overloading [2018/01/24 12:51] – created wolfgangriedmannmethod_overloading [2018/01/24 12:55] wolfgangriedmann
Line 25: Line 25:
 oClass:Foo( 1234 ) oClass:Foo( 1234 )
 </code> </code>
-Please note: a different return type is not a different, so this will not compile:+Please note: a different return type is not a different signature, so this will not compile:
 <code>method Foo( cString as string ) as string <code>method Foo( cString as string ) as string
 .... ....
 method Foo( cString as string ) as int</code> method Foo( cString as string ) as int</code>
 +
 +Of course this applies also to longer parameter lists. Here a sample piece of code that uses overloaded constructors and chains them:
 +<code>class MyClass
 +constructor( cFullName as string )
 +  return
 +constructor( cSurname as string, cName as string )
 +  super( cName + " " + cSurname )</code>
 +
  
  
method_overloading.txt · Last modified: 2018/01/24 12:56 by wolfgangriedmann