即将发布的Java 8版本中的虚拟扩展方法 [英] Virtual Extension Methods in upcoming Java 8 release

查看:117
本文介绍了即将发布的Java 8版本中的虚拟扩展方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我看到像

  interface A {
      void a();
      void b() default { System.out.println("b"); };
      void c() final { System.out.println("c"); };
  }

我有一个问题。 我们在Java中已经没有足够的sh * t了吗?为什么有人需要这个?

I have one question. Haven't we already got enough sh*t in Java? Why one might need this?

推荐答案

我建议你看看这个会议: http://medianetwork.oracle.com/media/show/16999

I suggest you to look at this conference : http://medianetwork.oracle.com/media/show/16999

这解释了一切。最有趣的事情是允许接口进化而不重写整个代码库。这是允许大型代码库发展而不会变得越来越残缺的关键。

This explain everything. The most interesting thing to do is to allow an interface to evolve without rewritting your whole codebase. This is key to allow a big codebase to evolve and not become more and more crippled.

这篇关于即将发布的Java 8版本中的虚拟扩展方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆