当前位置:网站首页>isArray()判断对象是否为数组
isArray()判断对象是否为数组
2022-06-09 19:27:00 【zhangsan3333】
package MapTest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public class Map8 {
public static void main(String[] args) {
String str = "aa";
Boolean b = true;
Integer a = 1;
Double c = 1.1;
ArrayList<String> list = new ArrayList<>();
Collections.addAll(list,"a","b","c");
int[] arr = new int[3];
HashMap<String, String> hashMap = new HashMap<>();
boolean array = list.getClass().isArray();
System.out.println("array = " + array);
boolean array1 = a.getClass().isArray();
System.out.println("array1 = " + array1);
boolean array2 = c.getClass().isArray();
System.out.println("array2 = " + array2);
boolean array3 = b.getClass().isArray();
System.out.println("array3 = " + array3);
boolean array4 = str.getClass().isArray();
System.out.println("array4 = " + array4);
boolean array5 = arr.getClass().isArray();
System.out.println("array5 = " + array5);
boolean array6 = hashMap.getClass().isArray();
System.out.println("array6 = " + array6);
}
}

边栏推荐
猜你喜欢

个人博客系统(附源码)

常熟理工小程序sql注入

Fast finding the number of nodes in a complete binary tree
MySQL has no service and the ultimate solution sharing that the service cannot be started

The white paper on the panorama of the digital economy, bank wealth management, was released
Redis生成全局唯一ID的实现方法

二叉树的按层遍历
![[ue5] calling worldsubsystem in uobject](/img/0d/ccc5b3b481eb8015f5a2bedb0d22d0.png)
[ue5] calling worldsubsystem in uobject

Using fingerprint for windows two factor identity authentication is both safe and convenient

Meinong bio is about to be listed: its operation has been relatively stable in the past three years, and it is estimated that the over raised amount is about 100million yuan
随机推荐
左手技术,右手生态!英特尔能否赢下这场“数据”战争?
Electron FAQ 60 - error: could not start audio source
线上运维要会用哪些运维软件和工具?
20XX年全国职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
只出现一次的数字(异或运算,哈希表)
MySQL has no service and the ultimate solution sharing that the service cannot be started
龙芯胡伟武:克服奴才心态,做自己的CPU指令系统!LoongArch将与X86/Arm并驾齐驱
【效能平台】测试用例管理模块——获取用例列表数据、查看用例详情数据、增加以及更新用例、删除用例相关功能开发(七)
How to generate a QR code picture (add a Chinese logo) and save it to the specified picture static service address, so as to solve the problem that there are no QR code Chinese characters.
The company is suspected of violating the ban to provide technical support to Huawei Hisilicon. Xinsi technology said it was cooperating with the U.S. government in the investigation
便利蜂存在违规收集个人信息行为遭通报,关联公司屡收罚单
Traversal by layer of binary tree
《数字经济全景白皮书》银行财富管理篇 重磅发布
搭建TypeScript开发环境
版号批下来,可公司已倒闭:现如今,做款游戏还能卖给腾讯吗?
Comment on "8 reasons why developers don't like low code and no code"
TPAMI2022 | 基于对抗性神经表示学习的异构域适应:电子商务与网络安全实验
Meinong bio is about to be listed: its operation has been relatively stable in the past three years, and it is estimated that the over raised amount is about 100million yuan
Zhaoguan electronics, a visual AI chip manufacturer, obtained a financing of 100 million yuan, led by ICBC capital
押宝云原生,Ampere Computing打响服务器芯片变革关键一枪