i have sample for to find out prime number , but i want to optimise is more. can anyone plz help me.

```
int i;
for (i=2; i < num ;i++ ){
int n = num%i;
if (n==0){
System.out.println("not Prime!");
break;
}
}
if(i == num){
System.out.println("Prime number!");
}
```

thnaks in adavance.