Using Yield Method in a Thread

 

public class Yield extends Thread {

  public void run() {
    //to stop thread 0
    Thread.yield();
    for (int i = 0; i < 5; i++) {
      System.out.println(i + ":" + Thread.currentThread().getName());
    }
  }

  public static void main(String[] args) {
    Yield y1 = new Yield();
    y1.start();
    //to stop main method and other thread get a chance to execute
    Thread.yield();
    for (int i = 0; i < 5; i++) {
      System.out.println(Thread.currentThread().getName() + ":" + i);
    }
  }
}

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