You are here: Home / Topics / Page / 3

System Information Top Linux Commands

Filed under: Linux on 2024-04-26 12:47:52
# Display Linux system informationuname -a# Display kernel release informationuname -r# Show operating system information such as distribution name and versioncat /etc/os-release# Show how long the system has been running + loaduptime# Show system host namehostname# Display all local IP addresses of

Program to explain Generic Interfaces in Java

Filed under: Java on 2024-04-13 09:09:43
//  Program to explain Generic Interfaces.interface MinMax<T extends Comparable<T>> {T min();T max();}class MyClass<T extends Comparable<T>> implements MinMax<T> {T[ ] vals;MyClass(T[ ] o) { vals = o;}public T min() { T v = vals[0

Program to explain Generic class with Wildcard in Java

Filed under: Java on 2024-04-13 09:06:42
// Program to explain Generic class with Wildcard.class  GenericStats<T extends Number> {T[ ]  nums;   GenericStats(T[ ]  o) { nums = o;}double average() { double sum = 0.0; for(int i=0; i < nums.length; i++) {  sum += nums[ i

Program 2 to explain Generic method with Bounded type in Java

Filed under: Java on 2024-04-12 18:38:35
// Program to explain Generic method with Bounded type.// GenericType<? extends upperBoundType>import java.util.ArrayList;import java.util.List;public class  GenericTest10 {public static double getAverage(List<? extends Number> numberList) { double total = 0.0; f