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); } }


上一篇:
下一篇:
切换中文