This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Vehicle{ | |
public String color; | |
public int wheels; | |
public int engine; | |
public void move(); | |
public void brake(); | |
public void stop(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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)); | |
} | |
} |
NewerOlder