Q:

Using BigDecimal in Java to calculate PI number up to 200 decimal digits

To estimate the number PI, I want to particulary use Monte Carlo method applying to a dart game with a circle with radius 1 inside a 1x1 square. More description can be found here. I want a Java code to estimate PI up to 200 digits. I have used BigDecimal but it shows 49 decimal digits and put zero number for the rest. I appreciate any helps.
import java.util.*;
import java.math.BigDecimal;

public class PiFinder {

    // description
    public static void main(String[] args) {
        Scanner iteration = new Scanner(System.in);
        System.out.print("Enter the number of iteration: ");
        int NoThrows = iteration.nextInt();
        BigDecimal PI = new BigDecimal(PIcalculation(NoThrows));
        PI = PI.setScale(200);

        // Difference of our estimated PI and the actual PI
        BigDecimal Difference = new BigDecimal(0);
        BigDecimal actualPI = new BigDecimal(Math.PI);
        System.out.println("Actual PI: " + actualPI);
        Difference = PI.subtract(actualPI);

        // Display results
        System.out.println("The Number of Throws = " + NoThrows);
        System.out.println("***************************");
        System.out.println("Estimated PI = " + PI);
        System.out.println("Difference = " + Difference);
    }

    // Deteremine a thrown dart is inside the circle
    public static boolean insideCircle(double pos_X, double pos_Y) {
        double distance = Math.sqrt((pos_X * pos_X) + (pos_Y * pos_Y));

        return (distance < 1.0);
    }

    public static double PIcalculation(int NoThrows) {
        Random randomGen = new Random(System.currentTimeMillis());
        int hits = 0;
        double PI = 0;

        for (int i = 1; i <= NoThrows; i++) {

            double pos_X = (randomGen.nextDouble()) * 2 - 1.0;
            double pos_Y = (randomGen.nextDouble()) * 2 - 1.0;

            if (insideCircle(pos_X, pos_Y)) {
                hits++;
            }
        }

        double dthrows = NoThrows;

        // the formule
        PI = (4.0 * (hits / dthrows));

        return PI;
    }
}

A:

Your PiCalculation returns a double, you can't expect to have more precision with this.
Use BigDecimal everywhere, if you want to go further.
But anyway with this method, even with 10^10 throws, you will only have 10 decimals.
The 49 decimals you had with your double, were due to the double lack of precision

