Pergunta de entrevista da empresa BAE Systems

write me a function in java that checks if a number is prime or not