What is the difference between == operator and .equals() method?


Answer: In general we use == operator for reference comparison,
whereas .equals() method for content comparison.
e.g.
String s1 = new String(“Java”);                                  
String s2 = new String(“Java”);
System.out.println(s1 == s2); //false                                      
System.out.println(s1.equals(s2)); //true                  
Both s1 and s2 refer to different memory locations. Hence both
References are different.
Note:
.equals() method present in object class also meant for reference comparison only
based on our requirement, we can override for content comparison
In String class, all wrapper classes and all collection classes,
 .equals() method is overridden for content comparison.

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