This file contains 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)); | |
} | |
} |
This file contains 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 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 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 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 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
[...document.querySelectorAll('.invite-card')].forEach((card) => { | |
const acceptBtn = card.querySelector('.bt-invite-accept'); | |
acceptBtn.click(); | |
}); |
This file contains 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
" don't bother with vi compatibility | |
set nocompatible | |
" enable syntax highlighting | |
syntax enable | |
" configure Vundle | |
filetype on " without this vim emits a zero exit status, later, because of :ft off | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ |
This file contains 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
import React, { Component } from 'react'; | |
import { View, Text } from 'react-native'; | |
import { Router, Scene, Actions } from 'react-native-router-flux'; | |
import Icon from 'react-native-vector-icons/Ionicons'; | |
import Shows from './OnAir'; | |
import Stations from './Stations'; | |
const TabIcon = props => { | |
console.log('selected', props.selected); //undefined | |
return ( |
This file contains 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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from "react"; | |
import { Text, View, StatusBar, Platform, Button } from "react-native"; | |
const MyStatusBar = ({ backgroundColor, ...props }) => |
This file contains 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
const counter = (state=0, action) => { | |
switch(action.type) { | |
case 'INCREMENT': | |
return state + 1; | |
case 'DECREMENT': | |
return state - 1; | |
default: | |
return state; | |
} | |
} |
OlderNewer