Anything wrong here?

import java.util.*;
public class Main {
public static void main (String args[]) {
Scanner s = new Scanner(System.in);
int len = s.nextInt();
int nums[] = new int[len];
int count0 = 0;
int product = 1;

    for(int i = 0; i < len; i++){
        nums[i] = s.nextInt();
        if (nums[i] == 0) {
            count0++;
        } else {
            product = product * nums[i];
        }
    }
    if(count0 == 0) {
        for(int ele: nums){
            int x = product/ele;
            System.out.print(x + " ");
        }
    } else if (count0 == 1) {
        for(int ele: nums){
            if(ele == 0){
                System.out.print(product + " ");
            } else {
                System.out.print("0 ");
            }
        }
    } else {
        for(int i=0; i < len; i++){
            System.out.print("0 ");
        }
    }
}

}

Hi,
actually i take doubts only in c++ so maybe u can close this doubt and reopen a new one if u are still facing any difficulty

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

I haven’t got the doubt cleared.
Is there anything wrong in my code?