当前位置:网站首页>How many knowledge points can a callable interface have?
How many knowledge points can a callable interface have?
2022-07-02 14:13:00 【User 1263954】
Concurrent programming has always been a headache for programmers , How to write a correct concurrent program compared to other programs , It's a more difficult thing , In concurrent programming Bug It is often very strange .
The reason why concurrent programming appears Bug It's weird , Because in concurrent programming , A lot of times Bug It may not be perfectly reproduced , in other words , Concurrent programming Bug It's hard to reproduce , Hard to track .
today , The glacier brought the little friends back again Callable Interface , Okay , Let's get to the point .
This article is pure dry goods , In depth analysis from the perspective of source code Callable Interface , I hope you will step down , Open your IDE, Follow the article to see the source code , I believe you will gain a lot .
Callable The interface is introduced
Callable Interface is JDK1.5 New generic interface , stay JDK1.8 in , Declared as a functional interface , As shown below .
@FunctionalInterface
public interface Callable<V> {
V call() throws Exception;
}
stay JDK 1.8 Only one method's interface is declared as a functional interface in , Functional interfaces can be used @FunctionalInterface To modify , You can also not use @FunctionalInterface To modify . As long as an interface contains only one method , that , This interface is a functional interface .
stay JDK in , Realization Callable The subclass of the interface is shown in the figure below .
The default subclass hierarchy diagram is not clear , here , Can pass IDEA Right click Callable Interface , choice “Layout” To specify the Callable Interface implementation, different structure of class diagram , As shown below .
here , You can choose “Organic Layout” Options , After selection Callable The structure of subclasses of interfaces is shown in the figure below .
In the realization of Callable In subclasses of interfaces , There are several important classes , As shown in the figure below .
边栏推荐
猜你喜欢

The 29 year old programmer in Shanghai was sentenced to 10 months for "deleting the database and running away" on the day of his resignation!

Who is better, Qianyuan projection Xiaoming Q1 pro or Jimi new play? Which configuration is higher than haqu K1?

MySQL 45 lecture - learning from the actual battle of geek time MySQL 45 Lecture Notes - 04 | easy to understand index (Part 1)

QT new project_ MyNotepad++

Selenium element positioning method

Integral link, inertia link and proportion link in Simulink

BeanUtils--浅拷贝--实例/原理

selenium,元素操作以及浏览器操作方法

Browser driven Download

刚好1000粉丝,记录一下
随机推荐
How kaggle uses utility script
抓包工具fiddler学习
Quarkus学习四 - 项目开发到部署
Multi rotor aircraft control using PID and LQR controllers
自定义事件,全局事件总线,消息订阅与发布,$nextTick
Selenium, element operation and browser operation methods
Use of swagger
Who is better, Qianyuan projection Xiaoming Q1 pro or Jimi new play? Which configuration is higher than haqu K1?
Subcontracting configuration of uniapp applet subpackages
Qt新项目_MyNotepad++
Codeforces Round #803 (Div. 2)(A~D)
uni-app中使用computed解决了tab切换中data()值显示的异常
使用BLoC 构建 Flutter的页面实例
Selenium element positioning method
The global special paper revenue in 2021 was about $27 million, and it is expected to reach $35 million in 2028. From 2022 to 2028, the CAGR was 3.8%
如何设置Qt手工布局
【虹科技术分享】如何测试 DNS 服务器:DNS 性能和响应时间测试
Default slot, named slot, scope slot
How to use SAP's metadata framework (MDF) to build custom business rules?
QT new project