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
|
363 Discussions
|
Please Login in order to post a comment
**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);
}
TypeScript
//javaScript
function printArray(array) { for (const element of array) { console.log(element); } }