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 poker; | |
public abstract class AbstractPolicy implements GamePolicy { | |
// map the strategy types - high card = 1, 2pair = 2, etc | |
public static int highCardLevel = 1; | |
public static int twoPairLevel = 2; | |
// protected level - strategies can read it | |
protected int level; |
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 hello; | |
import javax.annotation.Resource; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.ui.Model; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
@Controller |
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 review; | |
import java.util.HashMap; | |
import java.util.Map; | |
import javax.annotation.Resource; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.ui.Model; | |
import org.springframework.web.bind.annotation.RequestMapping; |
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
{ | |
"fortunes" : [ | |
"you're gonna get this", | |
"you're on the right track", | |
"Confucius says these are most aus·pi·cious times!", | |
"keep up the good work, you'll be dangerously famous", | |
"it's like that but better for you!" | |
] | |
} |
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.Observable; | |
/** | |
* Created by origin on 2/6/17. | |
*/ | |
public class BankAccount extends Observable { | |
private float balance; | |
public BankAccount() {} |
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.Scanner; | |
import java.util.function.BiFunction; | |
public class CalculatorTest { | |
public static void main(String[] args) { | |
BiFunction<Float, Float, Float> calculation = null; | |
Calculator calculator = new Calculator(); | |
Scanner scanner = new Scanner(System.in); |
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.Scanner; | |
public class GpaCalculatorTest { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
float[] gpaScale = { 4.0f, 3.5f, 3.0f, 2.5f, 2.0f }; | |
String[] grades; | |
float gpa = 0; | |
int index; |
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 Calculator { | |
public float sum(float firstValue, float secondValue) { | |
float sum = firstValue + secondValue; | |
return sum; | |
} | |
public float product(float firstValue, float secondValue) { | |
return firstValue * secondValue; | |
} | |
} |
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 BeerSong { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
int numBottles = 100; | |
singStanza(numBottles); | |
while (numBottles >= 67) { |