public class Primes {
public static void main(String[] args) {
int nFrom = Integer.parseInt(args[0]);
int nTo = Integer.parseInt(args[1]);
boolean isPrime = true;
for (int i = nFrom; i <= nTo; i++) {
isPrime = true;
for (int j = 2; j < i; j++) {
if (i % j == 0) {
isPrime = false;
break;
}
}
if (isPrime) {
System.out.println(i);
}
}
}
}
Izveidot jaunu programmu ar sekojošām īpašībām:
import java.text.*;
public class TestFormat {
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("##0.#####E0");
System.out.println(df.format(2002));
}
}
Izveidot strādājošu implementāciju klašu diagrammai, kura redzama attēlā un notestēt to (ar starpdruku metodi un JUnit)

Darbības: