{//获取对象的所有接口
Class<?>[] allInterfaces = ClassUtils.getAllInterfaces(ClassUtils.class);
System.out.println(allInterfaces[0].getName());
}
{//获取某个类的包名
String packageName = ClassUtils.getPackageName(ClassUtils.class);
System.out.println(packageName);
}
08-24
7549
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-19
1333
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31
2839
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-25
3164
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-16
1932
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-11
13万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)