摘要: 【Groovy】Array、List、Set、Map简介 1 Array 1.1 创建数组 1.1.1 创建一维数组 int[] arr1 = new int[2] arr1[0] = 1 arr1[1] = 2 float[] arr2 = new float[] { 1f, 2f, 3f } String[] arr3 = ["abc", "xyz"] 阅读全文
posted @ 2025-10-03 10:35 little_fat_sheep 阅读(21) 评论(0) 推荐(0)
摘要: 【Groovy】类和对象 1 类的结构 ​ Groovy 是面向对象编程语言,与 Java 语言类似,都有类、对象、属性、构造函数、成员函数,都有封装、继承、多态三大特性。 1.1 执行顺序 ​ 如下,Student 类是一个自定义的类,里面包含了一个类的基本结构。 class Student { private stati 阅读全文
posted @ 2025-10-03 10:34 little_fat_sheep 阅读(122) 评论(0) 推荐(0)