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 Cup implements Replenishable { | |
private int capacity; | |
private int amount; | |
public Cup(int c){ | |
capacity = c; | |
amount = 0; | |
} | |
public void fill(int foo) { |
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 Learable { | |
String listen(String concept); | |
boolean think(String heardMessage); | |
String respond(boolean understood); | |
} |
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 java.util.Random; | |
public class AwkwardCritter extends Critter { | |
public AwkwardCritter() { | |
super(); | |
} | |
public void passDay() { | |
changeAge(showAge() + 1); |
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 Cat extends Pet { | |
public Cat(){ | |
} | |
public void talk () { | |
System.out.println("purr"); |
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 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. |
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 Circle { | |
protected int radius; | |
public Circle(int r) { | |
setRadius(r); | |
} | |
public void setRadius(int r) { | |
radius = r; |
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 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. | |
*/ |
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
// 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); |
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
// 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]); | |
} | |
} |
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
package test_1; | |
public class Temp { | |
public static void main(String[] args) | |
{ | |
Temp temp = new Temp(); | |
} | |
public Temp() | |
{ |
NewerOlder