Java IdentityHashMap isEmpty()方法与示例
IdentityHashMap类isEmpty()方法 (IdentityHashMap Class isEmpty() method)
isEmpty() method is available in java.util package.
isEmpty()方法在java.util包中可用。
isEmpty() method is used to check whether this IdentityHashMap is "empty" or "not empty".
isEmpty()方法用于检查此IdentityHashMap是“空”还是“非空”。
isEmpty() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.
isEmpty()方法是一个非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。
isEmpty() method does not throw an exception at the time of checking the empty status of this IdentityHashMap.
在检查此IdentityHashMap的空白状态时, isEmpty()方法不会引发异常。
Syntax:
句法:
public boolean isEmpty();
Parameter(s):
参数:
It does not accept any parameter.
它不接受任何参数。
Return value:
返回值:
The return type of the method is boolean, it returns true when this IdentityHashMap is "empty" or "non-empty".
该方法的返回类型为boolean ,如果此IdentityHashMap为“空”或“非空”,则返回true。
Example:
例:
// Java program to demonstrate the example
// of boolean isEmpty() method of IdentityHashMap
import java.util.*;
public class IsEmptyOfIdentityHashMap {public static void main(String[] args) {// Instantiates a IdentityHashMap object
Map < Integer, String > map = new IdentityHashMap < Integer, String > ();
// By using put() method is to add
// key-value pairs in a IdentityHashMap
map.put(10, "C");
map.put(20, "C++");
map.put(50, "JAVA");
map.put(40, "PHP");
map.put(30, "SFDC");
// Display IdentityHashMap
System.out.println("IdentityHashMap: " + map);
// By using isEmpty() method is to
// check whether this IdentityHashMap is
// empty or not
boolean status = map.isEmpty();
// Display status
System.out.print("map.isEmpty(): ");
System.out.println(status);
}
}
Output
输出量
IdentityHashMap: {20=C++, 40=PHP, 50=JAVA, 30=SFDC, 10=C}
map.isEmpty(): false
翻译自: https://www.includehelp.com/java/identityhashmap-isempty-method-with-example.aspx
Java IdentityHashMap isEmpty()方法与示例相关推荐
- java vector.isempty,Java Vector isEmpty()方法与示例
向量类isEmpty()方法isEmpty()方法在java.util包中可用. isEmpty()方法用于检查此Vector是"空"还是"非空". isEmp ...
- java object isempty,Java JsonObject.isEmpty方法代码示例
import org.json.simple.JsonObject; //导入方法依赖的package包/类 public DockerContainerDetail getDetail(Docker ...
- Java IOUtils.copy方法代码示例(亲测)
本文整理汇总了Java中org.apache.commons.io.IOUtils.copy方法的典型用法代码示例.如果您正苦于以下问题:Java IOUtils.copy方法的具体用法?Java I ...
- java user directory,Java ProcessBuilder directory()方法与示例
语法:public File directory (); public ProcessBuilder directory (File dir); ProcessBuilder类directory()方 ...
- Java序列化魔术方法及其示例使用
在上一篇文章中, 您需要了解有关Java序列化的所有知识 ,我们讨论了如何通过实现Java序列化来启用类的可序列化性. Serializable接口. 如果我们的类未实现Serializable接口, ...
- catalog java,Java Connection getCatalog()方法与示例
通常,目录是一个目录,其中包含有关数据集,文件或数据库的信息.而数据库目录中包含所有数据库,基本表,视图(虚拟表),同义词,值范围,索引,用户和用户组的列表. Connection接口的getCata ...
- filepermission java,Java FilePermission getActions()方法与示例
FilePermission类getActions()方法getActions()方法在java.io包中可用. getActions()方法用于检查此FilePermission和给定对象在路径名和 ...
- java方法参数Bundle,Java ResourceBundle keySet()方法及示例
ResourceBundle类keySet()方法keySet()方法在java.util包中可用. keySet()方法用于从此ResourceBundle及其超级捆绑包中获取所有现有键,以在Set ...
- java exec waitfor,Java Process waitFor()方法与示例
流程类waitFor()方法在java.lang包中提供了waitFor()方法. waitFor()方法用于使当前正在运行的线程在需要时等待,直到由该Process对象表示的进程完成其终止为止. 当 ...
最新文章
- linux mint 下载辅助工具,Linux Mint 18.2 下载工具AxeluGet
- 【移动开发】Android中不用图片资源也能做出好看的界面
- 2005 打开 2010 项目经验总结
- B8.软件工程与设计模式
- VB FTP操作类(可上传、下载、创建文件夹等等)
- 水性油墨在纺织品印花中的应用
- 博达路由器常见功能教学0
- Java前端和后端的区别
- bex5 mysql_Bex5开发技巧之MYSQL Incorrect string value
- iOS面试前的准备计划(2022)
- 如何用卡诺图化简带有约束条件的逻辑函数?
- vi/vim怎么对多行文字进行注释/取消注释
- Win10下次使用debug进入DOS进行汇编开发
- 密码学常用英文单词翻译
- 拼多多校招-----六一儿童节(python)
- python 判断是否是元音字母
- ajaxSubmit来上传文件
- 天翼光猫虚拟服务器怎么设置,电信光猫设置经验图解手把手教你(超级详细),换光猫怎么重新设置...
- 优美段落集锦(高中)——希望能帮助当年的“我们”
- 从欧洲旅游到买房移民希腊的考察全记录!
热门文章
- roads 构筑极致用户体验_长安马自达「悦马星空」计划上线,为用户带来极致服务体验...
- css常用属性初总结:伪元素和伪元素
- oracle用EXPLAIN PLAN 分析SQL语句
- 二、先在SD卡上启动U-boot,再烧写新的U-boot进Nandflash
- 类的无参方法和Doc注释
- 009-MailUtils工具类模板
- 搭建mysql集群,使用Percona XtraDB Cluster搭建
- Ajax与CustomErrors的尴尬
- Python 辨异 —— __init__ 与 __new__
- Linux内核的启动过程分析