Java program to show multiple type parameters in Java Generics

 

//class having two different Generic Type
class TwoGen<T, V> {
T ob;
V ob1;

// constructor
public TwoGen(T t, V v) {
ob = t;
ob1 = v;
}

// method to get value of T type variable
T getOb() {
return ob;
}

// method to get value of V type variable
V getOb1() {
return ob1;
}

// method to print class name and argument type
void show() {
System.out.println("Type of T is : " + ob.getClass().getName());
System.out.println("Type of V is : " + ob1.getClass().getName());
}
}

// class containing main method
public class TwoGenDemo {
// driver method
public static void main(String[] args) {
// creating object of clas TwoGen and passing value
TwoGen<Integer, String> t = new TwoGen<>(5, "JAVAINVENT");
// calling show method to get details of arguments passed;
t.show();
// calling getob() method and saving its return value
Integer i = t.getOb();
// printing value of integer passed as argument
System.out.println(i);
// calling getob() method and saving its return value
String s = t.getOb1();
// printing value of String passed as argument
System.out.println(s);
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...