Inheritance

 

class Shape{
public void area(){
System.out.println("Displays area");
}
}

class Triangle extends Shape{
//shape->triangle -> Single level inheritance;
public void area(int l, int h){
System.out.println(1/2*l*h);
}

}

class EquilateralTriangle extends Triangle{ /
/ shape -> triangle -> equilateral-> multilevel inheritance
public void area(int l, int h){
System.out.println(1/2*l*h);
}
}

class Circle extends Shape{
// Shape-> triangle
public void area(int r){
//Shape -> Circle -> Hierarchial Inheritance
//Single base class and multiple derived classes
}
System.out.println(3.14*r*r);
}



public class TestInheritance{
public static void main(String args[]){
Triangle t1 = new Triangle();
t1.color = "Red";
}
}

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