给定一个LocalDate对象`date`,以下哪种操作可以获取`date`对象表示的年份信息?

答案解析

LocalDate类使用getYear()方法获取年份信息,year()不是LocalDate类的方法,get()方法需要传入枚举值,toYear()方法不存在。
正确答案:A
随机推荐
开始刷题