We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 21: Generics
Day 21: Generics
Sort by
recency
|
365 Discussions
|
Please Login in order to post a comment
c#
static void PrintArray(T[] a) { foreach(var i in a) { Console.WriteLine(i); } }
**c++ 11 // Write your code here
template void printArray(const vector& A) { for (const auto &element : A) { cout << element << endl; } }
**Java 8 Generic Solution **
import java.util.*;
public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in);
}