Hierarchical Inheritance(when two or more classes inherit a parent class)

 

class Animal {
void eat() {
System.out.println("An Animal is Created");
System.out.println("Animal eats");
}
}

class Dog extends Animal {

void bark() {
System.out.println("A dog barks");
}
}

class Cat extends Animal {
void height() {
System.out.println("A Cat is created");
System.out.println("A cat has small Height");
}

void sound() {
System.out.println("A cat sound is meow meow");
}
}

public class TestHierarchicalInheritance {
public static void main(String args[]) {

Cat cat = new Cat();

cat.eat();
cat.height();
cat.sound();

// cat.bark(); will be compile time error
// because class Cat doesn't inherit dog;
}
}

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