MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / GenClassMethod

Class GenClassMethod

Programs/GenClassMethod.java:3–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1package genclass;
2
3public class GenClassMethod {
4 public static <T> void printItems(T[] arr) {
5 for (int i = 0; i < arr.length; i++) {
6 System.out.print(arr[i] + " ");
7 }
8 }
9
10 public static void main(String[] args) {
11 // TODO Auto-generated method stub
12 String arr1[] = {"Cat", "Mouse", "Dog"};
13 Integer arr2[] = {1, 2, 3};
14 Double arr3[] = {10.5, 3.33, 7.33};
15
16 GenClassMethod.printItems(arr1);
17 GenClassMethod.printItems(arr2);
18 GenClassMethod.printItems(arr3);
19
20 }
21}
22
23// Using generic program, implement a stack

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected