Level of stack allowed by java

Does java specify how many level of stack is allowed? or it is machine dependent?

I try this function, it only allows me up to n=6955, n=6966 will cause stack overflow.

public static double fact(double n){

if(n==0) return 1;

}

[257 byte] By [william108a] at [2007-11-27 11:07:51]
# 1

> Does java specify how many level of stack is allowed?

http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#30934

~

yawmarka at 2007-7-29 13:24:44 > top of Java-index,Java Essentials,Java Programming...
# 2

Oops, the function should be:

public static double fact(double n){

if(n==0) return 1;

return fact(n-1)*n;

}

william108a at 2007-7-29 13:24:44 > top of Java-index,Java Essentials,Java Programming...
# 3

type in the console: java -?

you will get a bunch of options

now type: java -X

you will see: -Xss

read what it says

TuringPesta at 2007-7-29 13:24:44 > top of Java-index,Java Essentials,Java Programming...