Constructor Overloading


 class Worker5 {
    int id;
String name;
int age;
//Constructor with two arguments
Worker5(int i, String n) {
System.out.println("Constructor with two parameter was invoked");
id = i;
name = n;
}
//constructor with three arguments
Worker5(int i, String n, int a) {
System.out.println("Constructor with three parameter was invoked");
id = i;
name = n;
age = a;
}

void display() {
System.out.println("Id of worker is :" + id);
System.out.println("Name of worker is :" + name);
System.out.println("Age of worker is :" + age);
}

public static void main(String args[]) {
Worker5 w1 = new Worker5(123, "John");
Worker5 w2 = new Worker5(198, "Mohmad", 25);

w1.display(); //age will be zero i.e default value
w2.display();
}
}

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...