Quantcast

implement a mthod with unknow parameters

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

implement a mthod with unknow parameters

soulama
How do i implement a method like:

private void max(Double... doubles) {
    Double x = 0 ;
    for (Double d : doubles) {
        x+= d
    }
return x;
}
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: implement a mthod with unknow parameters

alexander_a_sokolov
Right now this is impossible in Beanshell because Beanshell only partly supports Java 5 syntax.

soulama wrote
How do i implement a method like:

private void max(Double... doubles) {
    Double x = 0 ;
    for (Double d : doubles) {
        x+= d
    }
return x;
}
Loading...