groovy
package com.example.mylibrary
import com.example.models.User
class MyLibrary {
def greetUser(User user) {
println "Hello, ${user.name}!"
}
}
package com.example.myapp;
import com.example.mylibrary.MyLibrary;
import com.example.models.User;
public class MyApp {
public static void main(String[] args) {
User user = new User("John");
MyLibrary myLibrary = new MyLibrary();
myLibrary.greetUser(user);
}
}