Skip to content

Instantly share code, notes, and snippets.

public class Cup implements Replenishable {
private int capacity;
private int amount;
public Cup(int c){
capacity = c;
amount = 0;
}
public void fill(int foo) {
interface Learable {
String listen(String concept);
boolean think(String heardMessage);
String respond(boolean understood);
}
import java.util.Random;
public class AwkwardCritter extends Critter {
public AwkwardCritter() {
super();
}
public void passDay() {
changeAge(showAge() + 1);
public class Cat extends Pet {
public Cat(){
}
public void talk () {
System.out.println("purr");
import java.io.*;
public class Browser {
private boolean browsing;
private WebVisit currentVisit;
private WebVisit noname;
/**
* Main method for the application. Create a new Browser object and set it to run.
public class Circle {
protected int radius;
public Circle(int r) {
setRadius(r);
}
public void setRadius(int r) {
radius = r;
@GrantSchiller
GrantSchiller / Browser.java
Created January 16, 2014 23:59
Browser history java
import java.io.*;
public class Browser {
private boolean browsing;
private WebVisit currentVisit;
/**
* Main method for the application. Create a new Browser object and set it to run.
*/
// Sorts an array of integers
import java.util.Arrays;
public class refresharray2 {
public static void main(String[] args){
int[] input = new int[]{1,3,2,5,4};
Arrays.sort(input);
for (int i: input) {
System.out.println(i);
// Reverses an array of integers.
public class reversearray {
public static void main(String[] args){
String input = "I was the shadow of the waxwing slain By the false azure in the windowpane I was the smudge of ashen fluff--and I Lived on, flew on, in the reflected sky, And from the inside, too, I'd duplicate Myself, my lamp, an apple on a plate: Uncurtaining the night, I'd let dark glass Hang all the furniture above the grass, And how delightful when a fall of snow Covered my glimpse of lawn and reached up so As to make chair and bed exactly stand Upon that snow, out in that crystal land!";
char[] inputArray = input.toCharArray();
for (int i = inputArray.length-1; i >= 0 ; i--){
System.out.print(inputArray[i]);
}
}
package test_1;
public class Temp {
public static void main(String[] args)
{
Temp temp = new Temp();
}
public Temp()
{