Hello,

I was wondering how much Groovy classes could be called from Java.

I am aware that solutions to call Groovy scripts are available like GroovyScriptLoader but I was thinking about simpler solutions.

This afternoon, while working on a classic Maven project, I noticed something weird : some Groovy classes were in the auto-completion list that IntelliJ was displaying me. So I decided to do a test and try calling a Groovy class from Java.

So I tried the following code :

```
String[] strings = { "Hello world"} ;
System.out.println(new GStringImpl(new Object[0], strings) ;
```

And it worked. So I suppose this is possible, in a way, that, if I wrote a Groovy class, I could instantiate it and call it's methods from Java code, right?
--
/Cordialement,
Christophe Henry/

Reply via email to