首页
归档
留言
广告合作
友链
美女主播
Search
1
博瑞GE车机升级/降级
5,146 阅读
2
Mac打印机设置黑白打印
4,517 阅读
3
修改elementUI中el-table树形结构图标
4,516 阅读
4
Mac客户端添加腾讯企业邮箱方法
4,351 阅读
5
intelliJ Idea 2022.2.X破解
4,060 阅读
Java
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
登录
/
注册
Search
标签搜索
Spring Boot
Java
Spring Cloud
Mac
mybatis
WordPress
Nacos
Spring Cloud Alibaba
Mybatis-Plus
jQuery
Java Script
asp.net
微信小程序
Sentinel
UniApp
MySQL
asp.net core
IntelliJ IDEA
Jpa
树莓派
Laughing
累计撰写
570
篇文章
累计收到
1,424
条评论
首页
栏目
Java
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
页面
归档
留言
广告合作
友链
美女主播
搜索到
4
篇与
的结果
2023-04-18
CentOS8使用yum安装OpenJDK1.8版本
1.下载OpenJDK先执行以下命令,查看OpenJDK版本yum --showduplicate list java*yum install java-1.8.0-openjdk* -y2.配置环境变量编辑profile文件vim /etc/profile在最末尾输入一下内容export JAVA_HOME=/usr/lib/jvm/java export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar export PATH=$PATH:$JAVA_HOME/bin生效环境变量source /etc/profile3.验证java -version看到如下内容,说明配置正确
2023年04月18日
525 阅读
0 评论
1 点赞
2022-11-13
JDK 8(Java SE Development Kit)全平台全版本安装包免费下载
Java虽然都更新到19了,但是我们日常使用比较多的还是Java8,虽然Spring Boot 3最低依赖都是Java17了,但是Java8的群体依然十分庞大。Java8(又称JDK 1.8)是Oracle于2014年3月19日发布正式版,是一个重要的长期支持版本(LTS),在生产环境中得到了普遍的运用;Java8 相比之前版本,新增了如下功能Lambda 表达式;使用函数式编程,使代码更少,更简洁;Data Time API 改进,优化对时间的处理新增 Stream API新增 Optional 类提供新的 Nashorn JavaScript 引擎,允许在 JVM 上运行特定的JS应用默认方法方法参数反射Oracle JDK 8u311下载安装平台下载地址密码Windows x64 64位jdk-8u311-windows-x648899Windows x86 32位jdk-8u311-windows-i5868899Linux x64 64位jdk-8u311-linux-x648899Linux x86 32位jdk-8u311-linux-i5868899Linux aarch 64位jdk-8u311-linux-aarch648899Linux arm 32位jdk-8u311-linux-arm328899MacOS x64 64位jdk-8u311-macosx-x648899Solarisjdk-8u311-solaris8899Oracle JDK 8u301下载安装平台下载地址下载密码Windows x64 64位jdk-8u301-windows-x648899Windows x86 32位jdk-8u301-windows-i5868899Linux x64 64位jdk-8u301-linux-x648899Linux x86 32位jdk-8u301-linux-i5868899Linux aarch64 64位jdk-8u301-linux-aarch648899Linux arm 32位jdk-8u301-linux-arm328899MacOS x64 64位jdk-8u301-macosx-x648899Solarisjdk-8u301-solaris8899Oracle JDK 8u291下载安装平台下载地址下载密码Windows x64 64位jdk-8u291-windows-x648899Windows x86 32位jdk-8u291-windows-i5868899Linux x64 64位jdk-8u291-linux-x648899Linux x86 32位jdk-8u291-linux-i5868899Linux aarch64 64位jdk-8u291-linux-aarch648899Linux arm 32位jdk-8u291-linux-arm328899MacOS x64 64位jdk-8u291-macosx8899Solarisjdk-8u291-solaris8899Oracle JDK 8u281下载安装平台下载地址密码Windows x64 64位jdk-8u281-windows-x648899Windows x86 32位jdk-8u281-windows-i5868899Linux x64 64位jdk-8u281-linux-x648899Linux x86 32位jdk-8u281-linux-i5868899Linux aarch64 64位jdk-8u281-linux-aarch648899Linux arm 32位jdk-8u281-linux-arm328899MacOS x64 64位jdk-8u281-macosx-x648899Solarisjdk-8u281-solaris8899Oracle JDK 8u271下载安装平台下载地址密码Windows x64 64位jdk-8u271-windows-x648899Windows x86 32位jdk-8u271-windows-i5868899Linux x64 64位jdk-8u271-linux-x648899Linux x86 32位jdk-8u271-linux-i5868899Linux aarch64 64位jdk-8u271-linux-aarch648899Linux arm 32位jdk-8u271-linux-arm328899MacOS x64 64位jdk-8u271-macosx-x648899Solarisjdk-8u271-solaris8899Oracle JDK 8u261下载安装平台下载地址密码Windows x64 64位jdk-8u261-windows-x648899Windows x86 32位jdk-8u261-windows-i5868899Linux x64 64位jdk-8u261-linux-x648899Linux x86 32位jdk-8u261-linux-i5868899Linux arm 64位jdk-8u261-linux-arm648899Linux arm 32位jdk-8u261-linux-arm328899MacOS x64 64位jdk-8u261-macosx-x648899Solarisjdk-8u261-solaris8899Oracle JDK 8u251下载安装平台下载地址密码Windows x64 64位jdk-8u251-windows-x648899Windows x86 32位jdk-8u251-windows-i5868899Linux x64 64位jdk-8u251-linux-x648899Linux x86 32位jdk-8u251-linux-i5868899Linux arm 64位jdk-8u251-linux-arm648899Linux arm 32位jdk-8u251-linux-arm328899MacOS x64 64位jdk-8u251-macosx-x648899Solarisjdk-8u251-solaris8899Oracle JDK 8u241下载安装平台下载地址密码Windows x64 64位jdk-8u241-windows-x648899Windows x86 32位jdk-8u241-windows-i5868899Linux x64 64位jdk-8u241-linux-x648899Linux x86 32位jdk-8u241-linux-i5868899Linux arm 64位jdk-8u241-linux-arm648899Linux arm 32位jdk-8u241-linux-arm328899MacOS x64 64位jdk-8u241-macosx-x648899Solarisjdk-8u241-solaris8899Oracle JDK 8u231下载安装平台下载地址密码Windows x64 64位jdk-8u231-windows-x648899Windows x86 32位jdk-8u231-windows-i5868899Linux x64 64位jdk-8u231-linux-x648899Linux x86 32位jdk-8u231-linux-i5868899Linux arm 64位jdk-8u231-linux-arm648899Linux arm 32位jdk-8u231-linux-arm328899MacOS x64 64位jdk-8u231-macosx-x648899Solarisjdk-8u231-solaris8899Oracle JDK 8u221下载安装平台下载地址密码Windows x64 64位jdk-8u221-windows-x648899Windows x86 32位jdk-8u221-windows-i5868899Linux x64 64位jdk-8u221-linux-x648899Linux x86 32位jdk-8u221-linux-i5868899Linux arm 64位jdk-8u221-linux-arm648899Linux arm 32位jdk-8u221-linux-arm328899MacOS x64 64位jdk-8u221-macosx-x648899Solarisjdk-8u221-solaris8899Oracle JDK 8u212下载安装平台下载地址密码Windows x64 64位jdk-8u212-windows-x648899Windows x86 32位jdk-8u212-windows-i5868899Linux x64 64位jdk-8u212-linux-x648899Linux x86 32位jdk-8u212-linux-i5868899Linux arm 64位jdk-8u212-linux-arm648899Linux arm 32位jdk-8u212-linux-arm328899MacOS x64 64位jdk-8u212-macosx-x648899Solarisjdk-8u212-solaris8899Oracle JDK 8u211下载安装平台下载地址密码Windows x64 64位jdk-8u211-windows-x648899Windows x86 32位jdk-8u211-windows-i5868899Linux x64 64位jdk-8u211-linux-x648899Linux x86 32位jdk-8u211-linux-i5868899Linux arm 64位jdk-8u211-linux-arm648899Linux arm 32位jdk-8u211-linux-arm328899MacOS x64 64位jdk-8u211-macosx-x648899Solarisjdk-8u211-solaris8899Oracle JDK 8u202下载安装平台下载地址密码Windows x64 64位jdk-8u202-windows-x648899Windows x86 32位jdk-8u202-windows-i5868899Linux x64 64位jdk-8u202-linux-x648899Linux x86 32位jdk-8u202-linux-i5868899Linux arm 64位jdk-8u202-linux-arm648899Linux arm 32位jdk-8u202-linux-arm328899MacOS x64 64位jdk-8u202-macosx-x648899Solarisjdk-8u202-solaris8899Oracle JDK 8u201下载安装平台下载地址密码Windows x64 64位jdk-8u201-windows-x648899Windows x86 32位jdk-8u201-windows-i5868899Linux x64 64位jdk-8u201-linux-x648899Linux x86 32位jdk-8u201-linux-i5868899Linux arm 64位jdk-8u201-linux-arm648899Linux arm 32位jdk-8u201-linux-arm328899MacOS x64 64位jdk-8u201-macosx-x648899Solarisjdk-8u201-solaris8899Oracle JDK 8u192下载安装平台下载地址密码Windows x64 64位jdk-8u192-windows-x648899Windows x86 32位jdk-8u192-windows-i5868899Linux x64 64位jdk-8u192-linux-x648899Linux x86 32位jdk-8u192-linux-i5868899Linux arm 64位jdk-8u192-linux-arm648899Linux arm 32位jdk-8u192-linux-arm328899MacOS x64 64位jdk-8u192-macosx-x648899Solaris*jdk-8u192-solaris8899Oracle JDK 8u191下载安装平台下载地址密码Windows x64 64位jdk-8u191-windows-x648899Windows x86 32位jdk-8u191-windows-i5868899Linux x64 64位jdk-8u191-linux-x648899Linux x86 32位jdk-8u191-linux-i5868899Linux arm 64位jdk-8u191-linux-arm648899Linux arm 32位jdk-8u191-linux-arm328899MacOS x64 64位jdk-8u191-macosx-x648899Solarisjdk-8u191-solaris8899Oracle JDK 8u181下载安装平台下载地址密码Windows x64 64位jdk-8u181-windows-x648899Windows x86 32位jdk-8u181-windows-i5868899Linux x64 64位jdk-8u181-linux-x648899Linux x86 32位jdk-8u181-linux-i5868899Linux arm 64位jdk-8u181-linux-arm648899Linux arm 32位jdk-8u181-linux-arm328899MacOS x64 64位jdk-8u181-macosx-x648899Solaris*jdk-8u181-solaris8899Oracle JDK 8u172下载安装平台下载地址密码Windows x64 64位jdk-8u172-windows-x648899Windows x86 32位jdk-8u172-windows-i5868899Linux x64 64位jdk-8u172-linux-x648899Linux x86 32位jdk-8u172-linux-i5868899Linux arm 64位jdk-8u172-linux-arm648899Linux arm 32位jdk-8u172-linux-arm328899MacOS x64 64位jdk-8u172-macosx-x648899Solaris*jdk-8u172-solaris8899Oracle JDK 8u171下载安装平台下载地址密码Windows x64 64位jdk-8u171-windows-x648899Windows x86 32位jdk-8u171-windows-i5868899Linux x64 64位jdk-8u171-linux-x648899Linux x86 32位jdk-8u171-linux-i5868899Linux arm 64位jdk-8u171-linux-arm648899Linux arm 32位jdk-8u171-linux-arm328899MacOS x64 64位jdk-8u171-macosx-x648899Solarisjdk-8u171-solaris8899Oracle JDK 8u162下载安装平台下载地址密码Windows x64 64位jre-8u162-windows-x648899Windows x86 32位*jre-8u162-windows-i5868899Linux x64 64位jre-8u162-linux-x648899Linux x86 32位jre-8u162-linux-i5868899Linux arm 64位jdk-8u162-linux-arm648899Linux arm 32位jdk-8u162-linux-arm328899MacOS x64 64位jre-8u162-macosx-x648899Solarisjdk-8u162-solaris8899Oracle JDK 8u161下载安装平台下载地址密码Windows x64 64位jdk-8u161-windows-x648899Windows x86 32位jdk-8u161-windows-i5868899Linux x64 64位jdk-8u161-linux-x648899Linux x86 32位jdk-8u161-linux-i5868899Linux arm 64位jdk-8u161-linux-arm648899Linux arm 32位jdk-8u161-linux-arm328899MacOS x64 64位jdk-8u161-macosx-x648899Solarisjdk-8u161-solaris8899Oracle JDK 8u152下载安装平台下载地址密码Windows x64 64位jdk-8u152-windows-x648899Windows x86 32位jdk-8u152-windows-i5868899Linux x64 64位jdk-8u152-linux-x648899Linux x86 32位jdk-8u152-linux-x648899Linux arm 64位jdk-8u152-linux-arm648899Linux arm 32位jdk-8u152-linux-arm328899MacOS x64 64位jdk-8u152-macosx-x648899Solaris*jdk-8u152-solaris8899Oracle JDK 8u151下载安装平台下载地址密码Windows x64 64位jdk-8u151-windows-x648899Windows x86 32位jdk-8u151-windows-i5868899Linux x64 64位jdk-8u151-linux-x648899Linux x86 32位jdk-8u151-linux-i5868899Linux arm 64位jdk-8u151-linux-arm648899Linux arm 32位jdk-8u151-linux-arm328899MacOS x64 64位jdk-8u151-macosx-x648899Solaris*jdk-8u151-solaris8899Oracle JDK 8u144下载安装平台下载地址密码Windows x64 64位jdk-8u144-windows-x648899Windows x86 32位jdk-8u144-windows-i5868899Linux x64 64位jdk-8u144-linux-x648899Linux x86 32位jdk-8u144-linux-i5868899Linux arm 64位jdk-8u144-linux-arm648899Linux arm 32位jdk-8u144-linux-arm328899MacOS x64 64位jdk-8u144-macosx-x648899Solarisjdk-8u144-solaris8899Oracle JDK 8u141下载安装平台下载地址密码Windows x64 64位jdk-8u141-windows-x648899Windows x86 32位jdk-8u141-windows-i5868899Linux x64 64位jdk-8u141-linux-x648899Linux x86 32位jdk-8u141-linux-i5868899Linux arm 64位jdk-8u141-linux-arm648899Linux arm 32位jdk-8u141-linux-arm328899MacOS x64 64位jdk-8u141-macosx-x648899Solarisjdk-8u141-solaris8899Oracle JDK 8u131下载安装平台下载地址密码Windows x64 64位jdk-8u131-windows-x648899Windows x86 32位jdk-8u131-windows-i5868899Linux x64 64位jdk-8u131-linux-x648899Linux x86 32位jdk-8u131-linux-i5868899Linux arm 64位jdk-8u131-linux-arm648899Linux arm 32位jdk-8u131-linux-arm328899MacOS x64 64位jdk-8u131-macosx-x648899Solarisjdk-8u131-solaris8899Oracle JDK 8u121下载安装平台下载地址密码Windows x64 64位jdk-8u121-windows-x648899Windows x86 32位jdk-8u121-windows-i5868899Linux x64 64位jdk-8u121-linux-x648899Linux x86 32位jdk-8u121-linux-i5868899Linux arm 64位jdk-8u121-linux-arm648899Linux arm 32位jdk-8u121-linux-arm328899MacOS x64 64位jdk-8u121-macosx-x648899Solarisjdk-8u121-solaris8899Oracle JDK 8u112下载安装平台下载地址密码Windows x64 64位jdk-8u112-windows-x648899Windows x86 32位jdk-8u112-windows-i5868899Linux x64 64位jdk-8u112-linux-x648899Linux x86 32位jdk-8u112-linux-i5868899Linux arm 64位jdk-8u112-linux-arm648899Linux arm 32位jdk-8u112-linux-arm328899MacOS x64 64位jdk-8u112-macosx-x648899Solarisjdk-8u112-solaris8899Oracle JDK 8u111下载安装平台下载地址密码Windows x64 64位jdk-8u111-windows-x648899Windows x86 32位jdk-8u111-windows-i5868899Linux x64 64位jdk-8u111-linux-x648899Linux x86 32位jdk-8u111-linux-i5868899Linux arm 64位jdk-8u111-linux-arm648899Linux arm 32位jdk-8u111-linux-arm328899MacOS x64 64位jdk-8u111-macosx-x648899Solarisjdk-8u111-solaris8899Oracle JDK 8u92下载安装平台下载地址密码Windows x64 64位jdk-8u92-windows-x648899Windows x86 32位jdk-8u92-windows-i5868899Linux x64 64位jdk-8u92-linux-x648899Linux x86 32位jdk-8u92-linux-i5868899Linux arm 64位jdk-8u92-linux-arm648899Linux arm 32位jdk-8u92-linux-arm328899MacOS x64 64位jdk-8u92-macosx-x648899Solarisjdk-8u92-solaris8899Oracle JDK 8u91下载安装平台下载地址密码Windows x64 64位jdk-8u91-windows-x648899Windows x86 32位jdk-8u91-windows-i5868899Linux x64 64位jdk-8u91-linux-x648899Linux x86 32位jdk-8u91-linux-i5868899Linux arm 64位jdk-8u91-linux-arm648899Linux arm 32位jdk-8u91-linux-arm328899MacOS x64 64位jdk-8u91-macosx-x648899Solarisjdk-8u91-solaris8899Oracle JDK 8u77下载安装平台下载地址密码Windows x64 64位jdk-8u77-windows-x648899Windows x86 32位jdk-8u77-windows-i5868899Linux x64 64位jdk-8u77-linux-x648899Linux x86 32位jdk-8u77-linux-i5868899Linux arm 64位jdk-8u77-linux-arm648899Linux arm 32位jdk-8u77-linux-arm328899MacOS x64 64位jdk-8u77-macosx-x648899Solarisjdk-8u77-solaris8899Oracle JDK 8u74下载安装平台下载地址密码Windows x64 64位jdk-8u74-windows-x648899Windows x86 32位jdk-8u74-windows-i5868899Linux x64 64位jdk-8u74-linux-x648899Linux x86 32位jdk-8u74-linux-i5868899MacOS x64 64位jdk-8u74-macosx-x648899Solarisjdk-8u74-solaris8899Oracle JDK 8u73下载安装平台下载地址密码Windows x64 64位jdk-8u73-windows-x648899Windows x86 32位jdk-8u73-windows-i5868899Linux x64 64位jdk-8u73-linux-x648899Linux x86 32位jdk-8u73-linux-i5868899Linux arm 64位jdk-8u73-linux-arm648899Linux arm 32位jdk-8u73-linux-arm328899MacOS x64 64位jdk-8u73-macosx-x648899Solarisjdk-8u73-solaris8899Oracle JDK 8u72下载安装平台下载地址密码Windows x64 64位jdk-8u72-windows-x648899Windows x86 32位jdk-8u72-windows-i5868899Linux x64 64位jdk-8u72-linux-x648899Linux x86 32位jdk-8u72-linux-i5868899MacOS x64 64位jdk-8u72-macosx-x648899Solarisjdk-8u72-solaris8899Oracle JDK 8u71下载安装平台下载地址密码Windows x64 64位jdk-8u71-windows-x648899Windows x86 32位jdk-8u71-windows-i5868899Linux x64 64位jdk-8u71-linux-x648899Linux x86 32位jdk-8u71-linux-i5868899Linux arm 64位jdk-8u71-linux-arm648899Linux arm 32位jdk-8u71-linux-arm328899MacOS x64 64位jdk-8u71-macosx-x648899Solarisjdk-8u71-solaris8899Oracle JDK 8u66下载安装平台下载地址密码Windows x64 64位jdk-8u66-windows-x648899Windows x86 32位jdk-8u66-windows-i5868899Linux x64 64位*jdk-8u66-linux-x648899Linux x86 32位jdk-8u66-linux-i5868899MacOS x64 64位jdk-8u66-macosx-x648899Solarisjdk-8u66-solaris8899Oracle JDK 8u65下载安装平台下载地址密码Windows x64 64位jdk-8u65-windows-x648899Windows x86 32位jdk-8u65-windows-i5868899Linux x64 64位jdk-8u65-linux-x648899Linux x86 32位jdk-8u65-linux-i5868899MacOS x64 64位jdk-8u65-macosx-x648899Solarisjdk-8u65-solaris8899Oracle JDK 8u60下载安装平台下载地址密码Windows x64 64位jdk-8u60-windows-x648899Windows x86 32位jdk-8u60-windows-i5868899Linux x64 64位jdk-8u60-linux-x648899Linux x86 32位jdk-8u60-linux-i5868899MacOS x64 64位jdk-8u60-macosx-x648899Solarisjdk-8u60-solaris8899Oracle JDK 8u51下载安装平台下载地址密码Windows x64 64位jdk-8u51-windows-x648899Windows x86 32位jdk-8u51-windows-i5868899Linux x64 64位jdk-8u51-linux-x648899Linux x86 32位jdk-8u51-linux-i5868899MacOS x64 64位jdk-8u51-macosx-x648899Solarisjdk-8u51-solaris8899Oracle JDK 8u45下载安装平台下载地址密码Windows x64 64位jdk-8u45-windows-x648899Windows x86 32位jdk-8u45-windows-i5868899Linux x64 64位jdk-8u45-linux-x648899Linux x86 32位jdk-8u45-linux-i5868899MacOS x64 64位jdk-8u45-macosx-x648899Solarisjdk-8u45-solaris8899Oracle JDK 8u40下载安装平台下载地址密码Windows x64 64位jdk-8u40-windows-x648899Windows x86 32位jdk-8u40-windows-i5868899Linux x64 64位jdk-8u40-linux-x648899Linux x86 32位jdk-8u40-linux-i5868899MacOS x64 64位jdk-8u40-macosx-x648899Solarisjdk-8u40-solaris8899Oracle JDK 8u31下载安装平台下载地址密码Windows x64 64位jdk-8u31-windows-x648899Windows x86 32位jdk-8u31-windows-i5868899Linux x64 64位jdk-8u31-linux-x648899Linux x86 32位jdk-8u31-linux-i5868899MacOS x64 64位jdk-8u31-macosx-x648899Solarisjdk-8u31-solaris8899Oracle JDK 8u25下载安装平台下载地址密码Windows x64 64位jdk-8u25-windows-x648899Windows x86 32位jdk-8u25-windows-i5868899Linux x64 64位jdk-8u25-linux-x648899Linux x86 32位jdk-8u25-linux-i5868899MacOS x64 64位jdk-8u25-macosx-x648899Solarisjdk-8u25-solaris8899Oracle JDK 8u20下载安装平台下载地址密码Windows x64 64位jdk-8u20-windows-x648899Windows x86 32位jdk-8u20-windows-i5868899Linux x64 64位jdk-8u20-linux-x648899Linux x86 32位jdk-8u20-linux-i5868899MacOS x64 64位jdk-8u20-macosx-x648899Solarisjdk-8u20-solaris8899Oracle JDK 8u11下载安装平台下载地址密码Windows x64 64位jdk-8u11-windows-x648899Windows x86 32位jdk-8u11-windows-i5868899Linux x64 64位jdk-8u11-linux-x648899Linux x86 32位jdk-8u11-linux-i5868899MacOS x64 64位jdk-8u11-macosx-x648899Solarisjdk-8u11-solaris8899Oracle JDK 8u5下载安装平台下载地址密码Windows x64 64位jdk-8u5-windows-x648899Windows x86 32位jdk-8u5-windows-i5868899Linux x64 64位jdk-8u5-linux-x648899Linux x86 32位jdk-8u5-linux-i5868899MacOS x64 64位jdk-8u5-macosx-x648899Solarisjdk-8u5-solaris8899Oracle JDK 8下载安装平台下载地址密码Windows x64 64位jdk-8-windows-x648899Windows x86 32位jdk-8-windows-i5868899Linux x64 64位jdk-8-linux-x648899Linux x86 32位jdk-8-linux-i5868899MacOS x64 64位jdk-8-macosx-x648899Solarisjdk-8-solaris8899
2022年11月13日
1,002 阅读
0 评论
2 点赞
2022-10-03
java8函数式接口注解FunctionalInterface
函数式接口就是为Java 8的Lambda表达式准备的,Java 8允许使用Lambda表达式创建函数式接口的实例,因此Java 8 专门增加了@FunctionalInterface。什么是函数式接口我们提到如果接口中只有一个抽象方法(可以包含多个默认方法或多个 static 方法),那么该接口就是函数式接口。FunctionalInterface作用@FunctionalInterface就是用来指定某个接口必须是函数式接口,所以@FunInterface只能修饰接口,不能修饰其它程序元素。看下一下面的方法@FunctionalInterface public interface BufferedReaderProcessor { /** * 静态方法 */ static void process() { System.out.println("process"); } /** * 抽象方法 * * @param bufferedReader * @return * @throws IOException */ String process(BufferedReader bufferedReader) throws IOException; /** * 默认方法 * * @param bufferedReader * @return * @throws IOException */ default String process1(BufferedReader bufferedReader) throws IOException { return ""; } }此时IDE是没有任何错误的(当然代码没有错误)截止到此时,我们出程序中的@FunctionalInterface一丢丢的作用,其实@FunctionalInterface注解的作用只是告诉IDE检查这个接口,保证该接口只能包含一个抽象方法,否则就会编译出错。如何理解一个抽象方法的含义。是否能只不包含抽象方法?我们继续修改刚才的代码,注释掉唯一的一个抽象方法 @FunctionalInterface public interface BufferedReaderProcessor { /** * 静态方法 */ static void process() { System.out.println("process"); } // /** // * 抽象方法 // * // * @param bufferedReader // * @return // * @throws IOException // */ // String process(BufferedReader bufferedReader) throws IOException; /** * 默认方法 * * @param bufferedReader * @return * @throws IOException */ default String process1(BufferedReader bufferedReader) throws IOException { return ""; } }此时,IDE给了错误提示了:No target method found(没有找到目标方法),也就是说,一旦使用@FunctionalInterface注解接口,我们必须要提供一个抽象方法。是否能提供多个抽象方法?刚刚我们看到了,一旦接口@FunctionalInterface,我们接口必须包含抽象方法,那么是否能包含多个抽象方法呢,我们看下面代码。@FunctionalInterface public interface BufferedReaderProcessor { /** * 静态方法 */ static void process() { System.out.println("process"); } /** * 抽象方法 * * @param bufferedReader * @return * @throws IOException */ String process(BufferedReader bufferedReader) throws IOException; /** * 抽象方法 * * @return */ String process1(); /** * 默认方法 * * @param bufferedReader * @return * @throws IOException */ default String process1(BufferedReader bufferedReader) throws IOException { return ""; } }此时ide提示Multiple non-overriding abstract methods found in XXX(找到多个非重载的抽象方法),也就是说,一个接口一旦注解了@FunctionalInterface就只能有一个抽象方法。
2022年10月03日
1,220 阅读
0 评论
3 点赞
2020-09-26
Mac查看已安装的jdk版本以及目录
最近学习https,想着借助java自带的keytool配置一下springboot的htts,因为需要进入%java_home%/bin。查看java目录命令如下/usr/libexec/java_home -V
2020年09月26日
1,510 阅读
0 评论
1 点赞