![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java基础
only_young
这个作者很懒,什么都没留下…
展开
-
JAVA反射解析-getDeclaredMethod方法
解析反射类java.lang.Class中的属性和方法1、public Method getDeclaredMethod(String name, Class<?>… parameterTypes)常用反射获取对象的方法Class<? extends UserController> clazz = userController.getClass();//<1>处代码在获取到Class对象之后,便可以获取有参方法① Method method = clazz.原创 2020-10-25 01:10:05 · 25370 阅读 · 2 评论 -
Java8中Stream的常用姿势
@Testpublic void streamTest() { Student stu1 = new Student(01, 19, "张三"); Student stu2 = new Student(02, 23, "李四"); Student stu3 = new Student(01, 28, "王五"); Student stu4 = new Student(01, 23, "赵六"); List<Student> list = new Arra原创 2020-08-02 01:25:38 · 339 阅读 · 0 评论 -
System.arrayCopy 的作用
下面是 System.arrayCopy的源代码声明 :public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)代码解释: Object src : 原数组 int srcPos : 从元数据的起始位置开始 Object dest : 目标数组 int ...原创 2020-05-02 22:48:42 · 2181 阅读 · 0 评论 -
java的左移运算符和右移运算符
java移位运算小技巧左移一位相当于乘以2的1次方,左移n位就相当于乘以2的n次方。右移一位相当于除以2的1次方,右移n位就相当于除以2的n次方。比如10 << 1 = 2010 << 3 = 806 >> 1 = 36 >> 2 = 1想要深入理解移位运算,就一定要对计算机的原码、反码、补码非常熟练。你要知道3个事(划重点):...原创 2020-05-02 22:46:22 · 556 阅读 · 0 评论