前言 在 SpringBoot 项目中,我们经常会使用两种占位符(有时候还会混用),它们分别是: @*@ ${*} 如果我们上网搜索「SpringBoot 的占位符 @」,大部分答案会告诉你,SpringBoot 的默认占位符由 ${*}变成 @*@了,更好一点的答案会引用 SpringBoot官网 中的描述: On the last point: since the default config files accept Spring style placeholders (${-}) th…
//1.常见的类型转换,使用static_cast float f = 1.234; int i =static_cast<int>(f);//等价于 int i = (int)f; //2.const_cast,将常量指针(指针指向的地址的值不能变)转变成非常量指针 int a = 1; const int * b = &a; *(const_cast<int*>(b)) = 2; //3.dynamic_cast,主要用于子类父类之间的转换,使用这个关键字进行转换会在转…
we have four specific casting operators:dynamic_cast, reinterpret_cast, static_cast and const_cast. Their format is to follow the new type enclosed between angle-brackets (<>) and immediately after, the expression to be converted between parentheses…
1.throws和throw的区别 throws使用在函数外,是编译时的异常,throw使用在函数内,是运行时的异常 使用方法 public int method(int[] arr) throws NullPointerException{} public int method(int[] arr){ if(arr==null){ throw new NullPointerException (“数组的引用不能为空”); } } throws 抛出的是异常类,可以抛出多个,用逗号隔开,thro…
C语言是一门通用计算机编程语言,应用广泛.C语言的设计目标是提供一种能以简易的方式编译.处理低级存储器.产生少量的机器码以及不需要任何运行环境支持便能运行的编程语言. C语言中的四种存储类别:auto(自动的).static(静态的).register(寄存器的).extern(外部的) 1.auto(自动的)例:auto int a:定义的整形变量a的存储方式是自动存储的,也就是说动态的分配存储空间和释放存储空间.比如说,在一个调用函数里定义的变量,当我们调用这个函数时,CPU在动态存储区分配…
JAVA中的四种JSON解析方式详解 我们在日常开发中少不了和JSON数据打交道,那么我们来看看JAVA中常用的JSON解析方式. 1.JSON官方 脱离框架使用 2.GSON 3.FastJSON 有问题 4.jackson 常用 JSON操作涉及到的类: public class Student { private int id; private String name; private int age; public int getId() { return id; } public vo…