Java
Java is a general-purpose, concurrent, strongly typed, class-based object-oriented programming language. It is normally compiled to the bytecode instruction set and binary format defined in the Java Virtual Machine Specification. The primary benefits of Java: cross-platform (Write Once, Run Anywhere (if all of the libraries are ported)), comprehensive class library (which is thoroughly documented), automatic memory management, large user community, well supported by the open source community and commercial industry (Sun, IBM, Oracle, HP, BEA, Apple Inc, etc.). Java is used in a variety of environments including desktop applications, embedded device (PDA and wireless phone) applications, server-side web page serving applications (as JSP), and applets embedded in web pages.
public class MathUtils {
public boolean isPrime(int n) {
for (int i=2; i*i<=n; i++) {
if (n%i==0) {
return true;
}
}
return false;
}
}
Version:
OpenJDK 1.6.0_20
Useful links:
Tasks:
Promise
8