```
public class Solution {
public int[] productExceptSelf(int[] nums) {
int product;
int [] arr = new int [nums.length];
for(int i = 0 ; i< nums.length;i++){
product = 1;
for(int j = 0; j<nums.length;j++){
if(i != j)
product = product*nums[j];
}
arr[i] = product;
}
return arr;
}
}
```