Java 8
LuckyGuyy
天道酬勤
展开
-
日期时间处理工具类
/** * 日期工具类 */public final class DateTimeUtils { /** * 构造器 */ private DateTimeUtils() { } /** 日本的ZoneId */ public static final ZoneId ZONE_ID_TOKYO = ZoneId.of("Asia/Tokyo"); /** DateFormatString uuuuMMdd */ publi原创 2020-10-29 09:14:56 · 773 阅读 · 0 评论 -
Java8新特性之------新的日期和时间API
文章目录Java8实战12.1 LocalDate、LocalTime、Instant、Duration以及Period12.1.1 使用LocalDate和LocalTime12.1.2 合并日期和时间12.1.3 机器的日期和时间格式12.1.4 定义Duration或Period12.2 操纵、解析和格式化日期12.2.1TemporalAdjuster操纵日期12.2.2 打印输出及解析日期-时间对象12.3 处理不同的时区和历法你应该了解简单的使用Java8实战12.1 LocalDate、L原创 2020-07-31 17:00:43 · 194 阅读 · 0 评论 -
Java8新特性之Date & Time
文章目录Local Date-Time 的简单使用Zoned 的简单使用Chrono Units EnumPeriod and DurationBackward CompatibilityJava 8 之前使用的时间类:Date存在缺点:Not thread safe - java.util.Date是非线程安全的,使用时必须处理并发问题。而新的时间类是不可变的,并且没有 set 方法。P...原创 2019-12-18 16:46:24 · 308 阅读 · 0 评论 -
Java8新特性之方法引用
文章目录通过对象名引用方法通过类名称引用静态方法通过super引用父类的成员方法通过this引用本类的成员方法类的构造器(构造方法)引用数组构造器引用通过对象名引用方法Printable.javapackage com.lucky;/** * 定义一个打印的函数式接口 */public interface Printable { //定义字符串的抽象方法 void ...原创 2019-10-30 10:07:32 · 164 阅读 · 0 评论 -
Java8新特性之Stream
文章目录Demo示例forEachfiltermapcountlimitskipconcatPractice练习Demo示例package com.lucky.stream;import java.util.ArrayList;import java.util.List;public class Demo { public static void main(String[] ...原创 2019-10-28 15:17:53 · 149 阅读 · 0 评论 -
Java8新特性之Lambda
文章目录获取流的方式Supplier_get (生产数据)Cunsumer_accept (消费数据)Consumer_andThenPredict_test(判断)Predict_andPredict_orPredict_negateFunction_apply(转换数据类型)Function_andThen获取流的方式1.Stream.of(T...)String[] arr = {"美...原创 2019-10-28 12:54:48 · 178 阅读 · 0 评论