- 博客(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.youkuaiyun.com/fukaibo121/article/details/764
2022-02-17 10:58:20
256
原创 python安装opencv
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple使用清华开源网站安装
2021-09-01 13:26:36
103
原创 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
118
原创 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
89
原创 2 Annotation
从JDK1.5 开始增加了Annotation功能,该功能可用于类、构造方法、成员变量、方法、参数等的声明中,其不影响程序的运行,但会对编译器警告等辅助工具产生影响。本文将介绍Annotation的使用。1.定义Annotation类型public @interface NoNumberAnnotation {}从示例中可以看出,定义Annotation类型的关键字是@interface,其隐含意思是继承了java.lang.annotation.Annotation接口。上述的Annotatio
2021-01-31 16:10:05
139
原创 1.3访问方法
其中invoke方法示例如下public class MethodInvoke {class Animal {public void print() {System.out.println(“Animal.print()”);}}class Cat extends Animal {@Overridepublic void print() {System.out.println(“Cat.print()”);}}public static void main(String[] a.
2021-01-26 14:53:31
302
原创 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
142
原创 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
119
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅