User Tools

Site Tools


generics

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
generics [2018/02/10 15:59]
wolfgangriedmann
generics [2018/08/20 06:06] (current)
wolfgangriedmann
Line 5: Line 5:
  
 As sample how to use generics look at the [[collections:list|System.Collections.Generic.List<T>]] class: As sample how to use generics look at the [[collections:list|System.Collections.Generic.List<T>]] class:
-<code>local oList as List<string>+<code visualfoxpro>local oList as List<string>
  
 oList := List<string>{} oList := List<string>{}
Line 11: Line 11:
 oList:Add( "hi guys" )</code> oList:Add( "hi guys" )</code>
 The List class is defined as follows: The List class is defined as follows:
-<code>public class List<T> implements IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T></code>+<code visualfoxpro>public class List<T> implements IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T></code>
 That means that you need to define which datatype the List object should contain. In the sample before it is a string, but it can be any datatype/class. That means that you need to define which datatype the List object should contain. In the sample before it is a string, but it can be any datatype/class.
  
generics.txt ยท Last modified: 2018/08/20 06:06 by wolfgangriedmann