Upload files to "OOP/Java/Lab/Week12"

This commit is contained in:
Aadit Agrawal 2024-10-26 02:14:18 +05:30
parent 2ae5d58f75
commit 100e80ccc3
5 changed files with 226 additions and 0 deletions

View file

@ -0,0 +1,24 @@
class Wildcard {
static void printArray(Object[] elements) {
for (Object element : elements) {
System.out.print(element + " ");
}
System.out.println();
}
public static void main(String[] args) {
Integer[] intArray = { 1, 2, 3, 4, 5 };
String[] stringArray = { "Hello", "World" };
Double[] doubleArray = { 1.1, 2.2, 3.3 };
System.out.println("Integer Array:");
printArray(intArray);
System.out.println("String Array:");
printArray(stringArray);
System.out.println("Double Array:");
printArray(doubleArray);
}
}