Unreachable Code
public static void findNum(int number) {
ArrayList<Integer> smallestFactorial = new ArrayList<Integer>();
boolean fin = false;
while (true) {
for (int i = 2; i <= number; i++) {
if (isPrime(i)) {
while (number % i == 0) {
smallestFactorial.add(i);
}
}
}
}
System.out.println("hello");
}
why don't you use the variable "fin"?
"while(true)" loops infinitely.
while (number % i == 0) {
number /= i;
smallestFactorial.add(i);
}
it is still unreachable code.
you must break "while (true)"