Groovy - sharing classes and functions between files
Summary:
Content (required):
is it possible to share classes and methods written in one groovy file (in groovy script) with other groovy script files.
E.g. If I have a file in my calc manager rules folder as follows: GroovyFile1 containing the class and function definitions as follows:
public class Car { String make String model double mpg public Car(String v_make, String v_model, double v_mpg) { make = v_make model = v_model mpg = v_mpg } double costPerMile() { return (1.51 * 4.54)/mpg } }
Then suppose I have a second file GroovyFile2 , is it possible to create instances of the class in this file from GroovyFile1 e.g.
Tagged:
0