Selection of programming language:
The Java language and JVM platform are very widely used so that techniques that you learn can be broadly useful. There are other JVM languages like JRuby, Clojure, Jython, and Scala that can use existing Java classes. While the examples in this book are written in Java you should have little trouble using my Java example classes and the open source libraries with these alternative JVM languages.
Simple java code:
public static class Problem {
// constants for appliance types: enum Appliance {REFRIGERATOR, MICROWAVE, TV, DVD}; //
constants for problem types:
enum ProblemType {
NOT_RUNNING, SMOKING, ON_FIRE, MAKES_NOISE
};
// constants for environmental data:
enum EnvironmentalDescription {
CIRCUIT_BREAKER_OFF, LIGHTS_OFF_IN_ROOM
};
Appliance appliance-type;
List
No comments:
Post a Comment