Java8特性簡(jiǎn)介

注:在2017年3月編寫的版本的基礎(chǔ)上,按簡(jiǎn)書要求清除了外鏈窜管,一些外部信息請(qǐng)自行檢索

Java8引入了哪些新特性橄仍?

  • Lambda表達(dá)式
  • Optional
  • Stream
  • 默認(rèn)方法
  • CompletableFuture
  • 新的日期和時(shí)間api

為何要關(guān)心這些特性

  • 聲明式編程 vs 命令式編程
  • 響應(yīng)式編程 vs 多線程編程
  • 面向函數(shù) vs 面向?qū)ο?/li>

Java 8 提供了更多的編程工具和概念韧涨,能夠以更簡(jiǎn)潔、更易于維護(hù)的方式解決新的和現(xiàn)有的編程問(wèn)題侮繁。


在Java6,7的環(huán)境中使用Java8的新特性

retrolambda:支持Lambda表達(dá)式,方法引用,接口靜態(tài)方法的backport庫(kù)
streamsupport:支持Stream,CompletableFuture,函數(shù)接口,Optional的backport庫(kù)
threetenbp:支持Java8時(shí)間日期api的backport庫(kù)


lambda表達(dá)式

Lambda表達(dá)式是一個(gè)匿名函數(shù)虑粥,可以作為參數(shù)傳遞給方法或者存儲(chǔ)在變量中。
Lambda表達(dá)式有參數(shù)列表宪哩、函數(shù)主體娩贷、返回類型,可以拋出異常锁孟。
Java中的lambda表達(dá)式僅僅是替代匿名內(nèi)部類的語(yǔ)法糖彬祖。

聲明表達(dá)式的例子↓

Runnable run = () -> {};

Runnable run = new Runnable() {
    @Override
    public void run() {
    }
};
BiFunction<Long, Long, Long> adder = (Long x, Long y) -> { return x + y; };

BiFunction<Long, Long, Long> adder = (x, y) -> x + y;
        
BiFunction<Long, Long, Long> adder = new BiFunction<Long, Long, Long>() {
    @Override
    public Long apply(Long x, Long y) {
        return x + y;
    }
};
Consumer<String> sayHi = (String name) -> System.out.println("Hi " + name);

Consumer<String> sayHi = new Consumer<String>() {
    @Override
    public void accept(String name) {
        System.out.println("Hi " + name);
    }
};
FileFilter filter = f -> f.isDirectory();

FileFilter filter = new FileFilter() {
    @Override
    public boolean accept(File f) {
        return f.isDirectory();
    }
};

局限性: 必須顯式或隱式的通過(guò)函數(shù)式接口聲明Lambda表達(dá)式 (表達(dá)式相同茁瘦,函數(shù)接口不同,則用途不同)储笑。

函數(shù)式接口: 只定義一個(gè)抽象方法的接口 (可通過(guò)標(biāo)注@FunctionalInterface提示編譯器進(jìn)行檢查)甜熔。

目標(biāo)類型: Lambda表達(dá)式需要的類型。Lambda表達(dá)式的類型會(huì)從上下文中推斷出來(lái)(類似List<String> list = new ArrayList<>;)突倍。

隱式聲明表達(dá)式的例子↓

file.listFiles(f -> f.isFile() && !f.isHidden());

file.listFiles(new FileFilter() {
    @Override
    public boolean accept(File f) {
        return f.isFile() && !f.isHidden();
    }
});
file.listFiles((dir, name) -> name.endsWith(".class"));

file.listFiles(new FilenameFilter() {
    @Override
    public boolean accept(File dir, String name) {
        return name.endsWith(".class");
    }
});
List<Integer> list = Arrays.asList(3, 5, 2, 1, 6);

list.sort((a, b) -> a.compareTo(b));

list.sort(new Comparator<Integer>() {
    @Override
    public int compare(Integer a, Integer b) {
        return a.compareTo(b);
    }
});

常用的函數(shù)式接口 (java.util.function.*)↓

函數(shù)式接口 函數(shù)描述符 使用場(chǎng)景
Predicate<T> T → boolean 各種filter
Consumer<T> T → void forEach的情形
Supplier<T> () → T 工廠函數(shù)
Function<T, R> T → R 對(duì)象轉(zhuǎn)換
BiFunction<T, U, R> (T, U) → R 對(duì)象轉(zhuǎn)換
UnaryOperator<T> T → T 一元運(yùn)算符
BinaryOperator<T> (T, T) → T 二元運(yùn)算符

方法引用

靜態(tài)方法引用 ↓

Function<String, Integer> parser = Integer::parseInt;

Function<String, Integer> parser = str -> Integer.parseInt(str);

實(shí)例方法引用↓

List<Integer> list = Arrays.asList(3, 5, 2, 1, 6);

list.sort(Integer::compareTo);

list.sort((a, b) -> a.compareTo(b));

// 下面的語(yǔ)句對(duì)應(yīng)靜態(tài)方法引用
list.sort(Integer::compare);

對(duì)象方法引用↓

CountDownLatch latch = new CountDownLatch(5);

for (int i = 0; i < 5; i++) {
    new Thread(latch::countDown).start();
    // 等價(jià)于
    // new Thread(() -> { latch.countDown(); }).start();
}

latch.await();

構(gòu)造方法引用↓

Executors.newCachedThreadPool(Thread::new);

Executors.newCachedThreadPool(r -> new Thread(r));

Executors.newCachedThreadPool(new ThreadFactory() {
    @Override
    public Thread newThread(Runnable r) {
        return new Thread(r);
    }
});

一些有用的Lambda復(fù)合方法 (將多個(gè)表達(dá)式整合成一個(gè))
java.util.Comparator提供的復(fù)合方法↓

List<Repo> repos = Arrays.asList(
        new Repo("code-service", true),
        new Repo("code-office", false),
        new Repo("code-browser", true));

repos.sort(Comparator
        .comparing(Repo::isFavorite)
        .reversed()
        .thenComparing(Repo::getName));

repos.stream().forEach(System.out::println);

輸出結(jié)果↓
code-browser true code-service true code-office false

java.util.function.Predicate提供的復(fù)合方法↓

IntPredicate p23 = v -> v % 23 == 0;
IntPredicate p3 = v -> v % 3 == 0;
IntPredicate p37 = v -> v % 37 == 0;

IntStream.rangeClosed(1, 100)
    .filter(p23
            .and(p3.negate())
            .or(p37))
    .forEach(v -> System.out.print(v + " "));

輸出結(jié)果:23 37 46 74 92

java.util.function.Function提供的復(fù)合方法↓

Function<Integer, Integer> f = x -> x + 1;
Function<Integer, Integer> g = x -> x * 2;
Function<Integer, Integer> h = f.andThen(g); // 等價(jià)于 x -> (x + 1) * 2

** 注意事項(xiàng)**

  1. Lambda表達(dá)式中的this
    靜態(tài)方法中聲明的Lambda表達(dá)式腔稀,內(nèi)部不允許出現(xiàn)this
    類實(shí)例的方法中聲明的Lambda表達(dá)式,內(nèi)部出現(xiàn)的this直接指向類實(shí)例本身
  2. 在表達(dá)式內(nèi)部對(duì)外部變量進(jìn)行引用(打折扣的閉包)
    Lambda表達(dá)式內(nèi)部引用的方法中的局部變量羽历,必須是不可變的(即使未聲明final關(guān)鍵字)
  3. Lambda表達(dá)式會(huì)讓棧跟蹤的分析變得更困難

Optional

“I call it my billion-dollar mistake. ... My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the temptation to put in a null reference, simply because it was so easy to implement.

from 《Invention of the null-reference a billion dollar mistake》
by Tony Hoare

null的壞處: 缺乏安全感
String name = revision.getCommit().getCommitter().getName();

通過(guò)使用Optional烧颖,消除業(yè)務(wù)代碼中對(duì)null的判斷

class RevisionInfo {
    private CommitInfo commit;
    public RevisionInfo(CommitInfo commit) {
        this.commit = commit;
    }
    public CommitInfo getCommit() {
        return commit;
    }
}

class CommitInfo {
    private String commit;
    private GitPersonInfo committer;
    public CommitInfo(String commit, GitPersonInfo committer){
        this.commit = commit;
        this.committer = committer;
    }
    public String getCommit() {
        return commit;
    }
    public GitPersonInfo getCommitter() {
        return committer;
    }
}

class GitPersonInfo {
    private String name;
    public GitPersonInfo(String name) {
        this.name = name;
    }
    public String getName() {
        return name;
    }
}

// 構(gòu)造數(shù)據(jù)
GitPersonInfo personInfo = new GitPersonInfo("yangziwen");
CommitInfo commitInfo = new CommitInfo("e0f181e", personInfo);
RevisionInfo revision = new RevisionInfo(commitInfo);
// 不使用Optional的寫法
String name = "";
if (revision != null) {
    CommitInfo commit = revision.getCommit();
    if (commit != null) {
        GitPersonInfo person = commit.getCommitter();
        if (person != null) {
            name = person.getName();
        }
    }
}
// 使用Optional的寫法
String name = Optional.ofNullable(revision)
        .map(RevisionInfo::getCommit)
        .map(CommitInfo::getCommitter)
        .map(GitPersonInfo::getName)
        .orElse("");

// 等價(jià)的寫法
String name = Optional.ofNullable(revision)
        .map(rev -> rev.getCommit())
        .map(commit -> commit.getCommitter())
        .map(commiter -> commiter.getName())
        .orElse("");

藉此實(shí)現(xiàn)了類似groovy中 def name = revision?.commit?.committer?.name?:""的效果

可通過(guò)如下方式創(chuàng)建Optional對(duì)象
Optional<String> optional = Optional.of("hello");
Optional<String> optional = Optional.ofNullable("world");
Optional<String> optional = Optional.empty();

注意事項(xiàng)

  1. Optional類沒(méi)有實(shí)現(xiàn)Serializable接口
  2. 不要在Model或DTO類中直接使用Optional做為字段類型
  3. 盡量不使用Optional的基礎(chǔ)類型 (如OptionalInt, OptionalLong)

Stream

遍歷數(shù)據(jù)集的高級(jí)迭代器
允許以聲明性方式處理數(shù)據(jù)集合,類似linux中的管道窄陡,或者jQuery的集合操作

List<Integer> list = Arrays.asList(3, 5, 1, 7, 2, 9, 3, 9, 1);

// 去重后炕淮,取出最大的三個(gè)奇數(shù)
List<Integer> threeBiggestOdds = list.stream()
    .distinct()
    .filter(d -> d % 2 == 1)
    .sorted(Comparator.reverseOrder())
    .limit(3)
    .collect(Collectors.toList());

// 不使用流的方式
Set<Integer> set = new TreeSet<>(new Comparator<Integer>() {
    @Override
    public int compare(Integer v1, Integer v2) {
        return v2.compareTo(v1);
    }
});
for (Integer v : list) {
    if (v % 2 == 1) {
        set.add(v);
    }
}
List<Integer> threeBiggestOdds = new ArrayList<>(set).subList(0, 3);

結(jié)果[9, 7, 5]

流的操作
中間操作:filter, map, sorted, skip, limit等 (繼續(xù)返回Stream對(duì)象)
終端操作:collect, forEach, min, max, count, anyMatch, findFirst等
一個(gè)Stream對(duì)象只能消費(fèi)(遍歷)一次,遍歷的執(zhí)行由終端操作觸發(fā)

int[] numbers = {4, 5, 3, 9};

// 求和
int result = Arrays.stream(numbers).reduce(0, (a, b) -> a + b);

// 等價(jià)于
int result = Arrays.stream(numbers).sum();

數(shù)值流

IntStream intStream = dishList.stream().mapToInt(Dish::getCalories);
Stream<Integer> stream = intStream.boxed();
IntStream.rangeClosed(1, 100).sum();

并行流

// 任務(wù)被分治拆解后跳夭,通過(guò)ForkJoinPool并行執(zhí)行
List<Integer> threeBiggestOdds = list.parallelStream()  // 直接創(chuàng)建并行流
    .distinct()
    .filter(d -> d % 2 == 1)
    .sorted(Comparator.reverseOrder())
    .limit(3)
    .collect(Collectors.toList());
List<Integer> threeBiggestOdds = list.stream()
    .distinct()
    .filter(d -> d % 2 == 1)
    .parallel()  // 在某一步轉(zhuǎn)換為并行流
    .sorted(Comparator.reverseOrder())
    .limit(3)
    .collect(Collectors.toList());

用流重構(gòu)代碼
簡(jiǎn)單的例子
重構(gòu)前↓

public List<GroupMember> getUsersByProduct(Product product, RepoMemberRole role) {
    List<ProductGroupRelation> relations = getProductGroupRelationsByProductId(product.getId());
    List<Long> groupIds = new ArrayList<>();
    for (ProductGroupRelation relation : relations) {
        if (role == null || role == relation.getRole()) {
            groupIds.add(relation.getGroupId());
        }
    }
    return groupService.getMembersByGroupIds(groupIds);
}

重構(gòu)后↓

public List<GroupMember> getusersByProduct(Product product, RepoMemberRole role) {
    return getProductGroupRelationsByProductId(product.getId())
            .stream()
            .filter(rel -> role == null || role == rel.getRole())
            .map(rel -> rel.getGroupId())
            .collect(collectingAndThen(toList(), groupService::getMembersByGroupIds));
}

復(fù)雜一些的例子
重構(gòu)前↓

public List<RepoMember> getRepoUsers(Repo repo) {
    List<RepoMember> users = repoMemberDao.selectRepoMemberByRepoID(repo.getId());
    users.addAll(getRepoUsersViaGroup(repo));

    Map<String, RepoMember> userMap = new HashMap<>();
    for (RepoMember user : users) {
        RepoMember prev = userMap.get(user.getUserName());
        if (prev == null) {
            userMap.put(user.getUserName(), user);
            continue;
        }
        if (prev.getRepoMemberRole().hasPermission(user.getRepoMemberRole())) {
            continue;
        }
        userMap.put(user.getUserName(), user);
    }
    List<RepoMember> result = Lists.newArrayList(userMap.values());
    Collections.sort(result, new Comparator<RepoMember>() {
        @Override
        public int compare(RepoMember user1, RepoMember user2) {
            int result = user1.getRepoMemberRole().compareTo(user2.getRepoMemberRole());
            if (result == 0) {
                result = user1.getUserName().compareTo(user2.getUserName());
            }
            return result;
        }
    });
    return result;
}

使用流重構(gòu)后↓

public List<RepoMember> getRepoUsers(Repo repo) {
    return Stream.concat(
            repoMemberDao.selectRepoMemberByRepoID(repo.getId()).stream(),
            getRepoUsersViaGroup(repo).stream())
        .collect(groupingBy(RepoMember::getUserName))  // 構(gòu)造userListMap
        .values().stream()
        .map(list -> list.stream().min(comparing(RepoMember::getRepoMemberRole))) // 每個(gè)user的最大權(quán)限
        .filter(Optional::isPresent)
        .map(Optional::get)
        .sorted(comparing(RepoMember::getRepoMemberRole)
                .thenComparing(RepoMember::getUserName))  // 先按角色排序涂圆,再按用戶名排序
        .collect(toList());
}

注意事項(xiàng)

  1. 并行流只適用于計(jì)算密集型的場(chǎng)景,不適合簡(jiǎn)單計(jì)算和IO密集型的場(chǎng)景
  2. 要注意使用流過(guò)程中基本類型的拆箱裝箱操作對(duì)性能的影響

默認(rèn)方法

接口中可定義以default關(guān)鍵字開(kāi)頭的非抽象非靜態(tài)的方法
用來(lái)對(duì)接口進(jìn)行擴(kuò)展币叹,可被實(shí)現(xiàn)類覆蓋(Override)
默認(rèn)方法只能調(diào)用本接口中的其他抽象方法或默認(rèn)方法

// List接口中的sort方法
@SuppressWarnings({"unchecked", "rawtypes"})
default void sort(Comparator<? super E> c) {
    Object[] a = this.toArray();
    Arrays.sort(a, (Comparator) c);
    ListIterator<E> i = this.listIterator();
    for (Object e : a) {
        i.next();
        i.set((E) e);
    }
}

多繼承問(wèn)題
接口中允許聲明默認(rèn)方法,造成了方法多繼承問(wèn)題的出現(xiàn)

解決問(wèn)題的三條規(guī)則

  1. 類中聲明的方法的優(yōu)先級(jí)高于接口中聲明的默認(rèn)方法

  2. 子接口中的默認(rèn)方法的優(yōu)先級(jí)高于父接口



  3. 繼承了多個(gè)接口的類必須通過(guò)顯示覆蓋和調(diào)用期望的方法,顯式的選擇使用哪個(gè)默認(rèn)方法的實(shí)現(xiàn)


interface A {
    default void hello () {
        System.out.println("Hello A");
    }
}

interface B {
    default void hello() {
        System.out.println("Hello B");
    }
}

class C implements A, B {
    @Override
    public void hello() {
        A.super.hello();
    }
}

CompletableFuture

Future接口只能以阻塞的方式獲取結(jié)果,因此引入CompletableFuture,從而可以非阻塞(回調(diào))的方式獲取和處理結(jié)果
類似jQuery中基于Promise/Deferred模式的ajax api

輔助代碼↓

static long now() {
    return System.currentTimeMillis();
}

// 產(chǎn)生一個(gè)1s到3s的延遲,模仿IO操作
static double randomDelay() {
    long t = now();
    sleepQuietly((new Random().nextInt(20) + 10) * 100L);
    return (now() - t) / 1000D;
}

static void sleepQuietly(Long millis) {
    try {
        Thread.sleep(millis);
    } catch (InterruptedException e) {
    }
}

例子1:串行的執(zhí)行兩個(gè)IO操作祸憋,并通過(guò)回調(diào)的方式處理結(jié)果

public static void main(String[] args) {
    ExecutorService executor = Executors.newFixedThreadPool(10);
    long t = now();
    CompletableFuture.supplyAsync(() -> {
        System.out.println("delay before task is " + (now() - t) / 1000D);
        return randomDelay();
    }, executor)
    .thenAccept(d1 -> System.out.println("delay of 1st task is " + d1))
    .thenCompose(d1 -> CompletableFuture.supplyAsync(() -> {
        return randomDelay();
    }, executor))
    .thenAccept(d2 -> System.out.println("delay of 2nd task is " + d2))
    .thenAccept(d2 -> System.out.println("total time is " + (now() - t) / 1000D))
    .thenAcceptAsync(d2 -> executor.shutdown());
}

例子2:并行的執(zhí)行兩個(gè)IO操作巍沙,并通過(guò)回調(diào)的方式處理結(jié)果

static final ExecutorService executor = Executors.newFixedThreadPool(10);

public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) {
    return CompletableFuture.supplyAsync(supplier, executor);
}

public static void main(String[] args) {
    long t = now();
    supplyAsync(() -> {
        System.out.println("delay before task is " + (now() - t) / 1000D);
        return randomDelay();
    }).thenCombine(supplyAsync(() -> {
        return randomDelay();
    }), (d1, d2) -> Arrays.asList(d1, d2))
    .thenAccept(delays -> {
        AtomicInteger counter = new AtomicInteger(0);
        delays.stream().forEach(delay -> {
            System.out.println("delay of task" + counter.incrementAndGet() + " is " + delay);
        });
        System.out.println("total delay is " + (now() - t) / 1000D);
    })
    .thenAcceptAsync(delays -> executor.shutdown());
}

注意事項(xiàng)

  1. 基于Blocking-IO的IO密集型應(yīng)用不要使用ForkJoinPool (CompletableFuture默認(rèn)使用ForkJoinPool牍疏,因此需指定自定義的線程池)
  2. 在高并發(fā)下厦滤,線程數(shù)的設(shè)置可參考如下公式
    其中
    Nthreads:高并發(fā)下線程池的理想線程數(shù)
    NCPU:CPU內(nèi)核個(gè)數(shù)忍啸,可通過(guò)Runtime.getRuntime().availableProcessors()獲取
    UCPU:CPU總利用率悄晃,取值在0到1之間
    W / C:CPU占空比(C為占用的時(shí)間,W為空閑的時(shí)間)

新的日期和時(shí)間api

Java曾經(jīng)在同一個(gè)地方摔倒了兩次 → Date and Calendar
new Date(117, 1, 16); // 2017-02-16
DateFormat // 線程不安全
Calendar // 仍然不好用 (線程不安全,可變妈橄,不支持格式化)

為了阻止悲劇反復(fù)上演庶近,Java8決定整合Joda-Time的特性
LocalDate / LocalTime / LocalDateTime

LocalDate date = LocalDate.of(2017, 2, 16);

LocalDate today = LocalDate.now();

LocalDate date = LocalDate.parse("2017-02-16");  // 只拋運(yùn)行時(shí)異常

DateTimeFormatter formatter = new DateTimeFormatter.ofPattern("yyyy/MM/dd"); // 線程安全
LocalDate date = LocalDate.parse("2017/02/16", formatter);  // 只拋運(yùn)行時(shí)異常

Period // 按日計(jì)的時(shí)間間隔
Duration // 按秒記得時(shí)間間隔

TemporalAdjuster 調(diào)整日期時(shí)間

import static java.time.temporal.TemporalAdjusters.*;

LocalDate date = LocalDate.parse("2017-02-16").with(nextOrSame(DayOfWeek.SATURDAY));

時(shí)區(qū)

ZonedDateTime time = LocalDateTime.now().atZone(ZoneId.systemDefault());

ZonedDateTime londonTime = time.withZoneSameInstant(ZoneId.of("Europe/London"));

歷法
ThaiBuddhistDate // 泰國(guó)佛教歷
MinguoDate // 中華民國(guó)歷
JapaneseDate // 日本歷
HijrahDate // 伊斯蘭歷

MinguoDate date = MinguoDate.from(LocalDate.parse("2017-02-16"));
// Minguo ROC 106-02-16
JapaneseDate date = JapaneseDate.from(LocalDate.parse("2017-02-16"));
// Japanese Heisei 29-02-16

注意事項(xiàng)

  1. 所有的日期和時(shí)間對(duì)象,都是不可變對(duì)象眷蚓,所以一定是線程安全的
  2. 盡量不用各種其他的歷法(ChronoLocalDate)鼻种,在系統(tǒng)中統(tǒng)一使用LocalDate(ISO-8061的時(shí)間和日期標(biāo)準(zhǔn))
  3. LocalDateTime應(yīng)用于MyBatis,需要自定義相應(yīng)類型的handler沙热,實(shí)現(xiàn)java.sql.Timestamp與LocalDateTime之間的轉(zhuǎn)換

更多內(nèi)容:JAVA 8:健壯叉钥、易用的時(shí)間/日期API

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市篙贸,隨后出現(xiàn)的幾起案子投队,更是在濱河造成了極大的恐慌,老刑警劉巖爵川,帶你破解...
    沈念sama閱讀 218,386評(píng)論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件敷鸦,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡寝贡,警方通過(guò)查閱死者的電腦和手機(jī)轧膘,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,142評(píng)論 3 394
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)兔甘,“玉大人谎碍,你說(shuō)我怎么就攤上這事《幢海” “怎么了蟆淀?”我有些...
    開(kāi)封第一講書人閱讀 164,704評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)澡匪。 經(jīng)常有香客問(wèn)我熔任,道長(zhǎng),這世上最難降的妖魔是什么唁情? 我笑而不...
    開(kāi)封第一講書人閱讀 58,702評(píng)論 1 294
  • 正文 為了忘掉前任疑苔,我火速辦了婚禮,結(jié)果婚禮上甸鸟,老公的妹妹穿的比我還像新娘啸箫。我一直安慰自己励稳,他們只是感情好甜紫,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,716評(píng)論 6 392
  • 文/花漫 我一把揭開(kāi)白布昔期。 她就那樣靜靜地躺著,像睡著了一般刻恭。 火紅的嫁衣襯著肌膚如雪瞧省。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書人閱讀 51,573評(píng)論 1 305
  • 那天,我揣著相機(jī)與錄音鞍匾,去河邊找鬼交洗。 笑死,一個(gè)胖子當(dāng)著我的面吹牛橡淑,可吹牛的內(nèi)容都是我干的构拳。 我是一名探鬼主播,決...
    沈念sama閱讀 40,314評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼梳码,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼隐圾!你這毒婦竟也來(lái)了伍掀?” 一聲冷哼從身側(cè)響起掰茶,我...
    開(kāi)封第一講書人閱讀 39,230評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎蜜笤,沒(méi)想到半個(gè)月后濒蒋,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,680評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡把兔,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,873評(píng)論 3 336
  • 正文 我和宋清朗相戀三年沪伙,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片县好。...
    茶點(diǎn)故事閱讀 39,991評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡围橡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出缕贡,到底是詐尸還是另有隱情翁授,我是刑警寧澤,帶...
    沈念sama閱讀 35,706評(píng)論 5 346
  • 正文 年R本政府宣布晾咪,位于F島的核電站收擦,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏谍倦。R本人自食惡果不足惜塞赂,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,329評(píng)論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望昼蛀。 院中可真熱鬧宴猾,春花似錦、人聲如沸叼旋。這莊子的主人今日做“春日...
    開(kāi)封第一講書人閱讀 31,910評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)送淆。三九已至税产,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背辟拷。 一陣腳步聲響...
    開(kāi)封第一講書人閱讀 33,038評(píng)論 1 270
  • 我被黑心中介騙來(lái)泰國(guó)打工撞羽, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人衫冻。 一個(gè)月前我還...
    沈念sama閱讀 48,158評(píng)論 3 370
  • 正文 我出身青樓诀紊,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親隅俘。 傳聞我的和親對(duì)象是個(gè)殘疾皇子邻奠,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,941評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容