Calculating Square of a number Using Lambda Expression

 

//without lambda expression
 interface Square {
    public int mul(int x);
}

class Demo1 implements Square {
    public int mul(int x) {
        return x * x; // or (int x)->x*x;
    }
}

public class Multiply {
    public static void main(String[] args) {
        Square s = new Demo1();
        System.out.println("The square is : " + s.mul(8));
    }
}
//with Lambda Expression
interface Square {
    public int mul(int x);
}
public class Multiply {
    public static void main(String[] args) {
        Square s = x -> {
            return x * x;
        };
        System.out.println("The square is :" + s.mul(5));
        s.mul(5);
    }
}

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