- 博客(8)
- 收藏
- 关注
原创 【无标题】
c++ 中引用和数组的一些见解 int ar[2] = {1,2}; int * p_ar = ar; int * & temp = p_ar; int (&t)[2] = ar; // int &t[2];invalid 从以上代码我们得出结论 数组初始化时不能使用指针的格式 可以有bind数组的引用,但是不能有引用数组(具体原因见:https://blog.csdn.net/fukaibo121/article/details/764
2022-02-17 10:58:20
213
原创 python安装opencv
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple 使用清华开源网站安装
2021-09-01 13:26:36
54
原创 2021-08-04
第十章:文件和异常 10.1 从文件中读取数据 读取整个文件(文件名一定不能加文件类型后缀) file_name = 'pi_digits' # 打开并读取这个文件 # 使用with关键字 with open(file_name) as file_object: content = file_object.read() print(content) with open(file_name) as file_object 要以任何方式使用文件,都要先打开文件。open()接受文件名称,pyth
2021-08-04 17:31:32
46
原创 2021-06-13
matlab中布尔型的用法 allow_index = ~ismember(citys_index,tabu); allow = citys_index(allow_index); % 待访问的城市集合 allow_index是布尔型,为1和0的数组,即citys_index中元素是否赋值给allow由allow_index控制
2021-06-13 15:47:55
47
原创 2 Annotation
从JDK1.5 开始增加了Annotation功能,该功能可用于类、构造方法、成员变量、方法、参数等的声明中,其不影响程序的运行,但会对编译器警告等辅助工具产生影响。本文将介绍Annotation的使用。 1.定义Annotation类型 public @interface NoNumberAnnotation { } 从示例中可以看出,定义Annotation类型的关键字是@interface,其隐含意思是继承了java.lang.annotation.Annotation接口。 上述的Annotatio
2021-01-31 16:10:05
60
原创 1.3访问方法
其中invoke方法 示例如下 public class MethodInvoke { class Animal { public void print() { System.out.println(“Animal.print()”); } } class Cat extends Animal { @Override public void print() { System.out.println(“Cat.print()”); } } public static void main(String[] a.
2021-01-26 14:53:31
235
原创 1.2访问成员变量:Field类
/*访问成员变量,返回field类型的对象或数组。 每个field对象代表一个成员变量 getFields(); getField(String name); getDeclaredFields(); getDeclaredField(String name); exp: object(Field类).getDeclaredField(“birthday”); Field类的常用方法: getName():获得成员变量名称 getType():获得表示该成员变量类型的Class对象 get(Object o
2021-01-25 23:25:37
90
原创 Java反射 1-1访问构造方法
Java反射 1-1访问构造方法 思路如下: 创建Class类对象,以获得constructor[ ] 循环或流访问每一个构造方法:获得修饰符、异常信息类型、入口参数类型 如果是if i==2,此时构造方法修饰符是private,需要用setAccessible方法绕过系统权限,根据constructor1.newinstance()创建对象。 Class exampleC=Example01.class;//先获得Example01对应的Class类 //获得所有构造方法
2021-01-23 11:40:04
77
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人