Method Reference


//With lambda Expression
class MethodRef {

  public static void main(String[] args) {
    Runnable r = () -> {
      for (int i = 0; i <= 10; i++) {
        System.out.println("Child Thread");
      }
    };
    Thread t = new Thread(r);
    t.start();
    for (int i = 0; i <= 10; i++) {
      System.out.println("Main Thread");
    }
  }
}

//With Method Reference

class MethodRef {

  public static void m1() {
    for (int i = 0; i <= 10; i++) {
      System.out.println("Child Thread");
    }
  }

  public static void main(String[] args) {
    Runnable r = MethodRef::m1;
    Thread t = new Thread(r);
    t.start();
    for (int i = 0; i <= 10; i++) {
      System.out.println("Main Thread");
    }
  }
}

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