首先定义一个urse package com.studay_fanshe; public class User { private String uname; private int age; private int id; public User() { } public User(String uname, int age, int id) { this.uname = uname; this.age = age; this.id = id; } public String getUname…
1. 枚举: ->在Swift中依然适用整数来标示枚举值,需搭配case关键字 enum Celebrity{ case DongXie,XiDu,Nandi,BeiGai } // 从左到右对应0,1,2,3 enum CompassPoint { case North case South case East case West //enum中可以定义方法 func show(){ print(self) } } //定义enum 变量 var p = CompassPoint.Nor…