Skip to content

Instantly share code, notes, and snippets.

View Chiamaka's full-sized avatar

Chiamaka Nwolisa Chiamaka

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href="https://fonts.googleapis.com/css?family=Arimo" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" media="screen" title="no title">
<style media="screen">
body {
height: 100%;
public class Vehicle{
public String color;
public int wheels;
public int engine;
public void move();
public void brake();
public void stop();
}
// abstract class BankAccount that cannot be instiatied but can be inherit by subclasses
public abstract class BankAccount{
private int accountNumber;
private String accountName;
private int balance;
public void deposit();
public void withdraw();
}
interface Printable{
//it possesses no functonality within the methods.
//It just contains method signatures.
void Print();
void printToPDF(String filename);
}
class MyClass implements Printable{
public void Print(){
// add functionality
//class Example to illustrate polymorphism with the + sign
class Example{
public void add(int a, int b){
System.out.println(a + b);
}
public void addStatement(int a, int b){
System.out.println("The sum of a and b is: " + (a+b));
}
}