1. 问号后面带的参数 url:http://localhost:4200/news?key=japan html 调用方法: <a [routerLink]="['/news']" [queryParams]="{key:'japan'}"> 跳转 ts 调用方法: private router: ...
分类:
其他好文 时间:
2021-01-05 10:50:30
阅读次数:
0
@NotNull(message="名字不能为空") private String userName; @Max(value=12,message="年龄最大不能查过12") private int age; @Email(message="邮箱格式错误") private String email ...
分类:
Web程序 时间:
2021-01-05 10:36:55
阅读次数:
0
a、可变性:String类中使用字符数组保存字符串,private final char value[], 所以string对象是不可变的。StringBuilder与StringBuffer都继承自AbstractStringBuilder类, 在AbstractStringBuilder中也是使 ...
分类:
其他好文 时间:
2021-01-04 11:14:48
阅读次数:
0
Java私有构造器:使用private关键字声明的构造函数。由于类的构造函数时私有的,所以此类不能被实例化,同时也不能被继承。《Effective Java》第三条:用私有构造器或者枚举强化Singleton属性。所谓Singleton属性是指仅仅被实例化一次的类。第四条:通过私有构造器强化不可实例 ...
分类:
编程语言 时间:
2021-01-04 11:01:13
阅读次数:
0
现在我们解决一下属性名和字段名不一致的问题 实体类的属性如下: 1 public class User { 2 private int id; 3 private String name; 4 private String password; 5 } 接口: 1 public interface U ...
分类:
数据库 时间:
2021-01-04 11:00:31
阅读次数:
0
/// /// 学员类 /// public class Student { #region 字段 //字段,又称为"成员变量",一般在类的内部做数据交互使用,一般使用Private修饰。 //字段命名规范:一般采用Caml命名法,即首字母小写。 //字段的通俗理解:字段好比我们的个人财产,只供我们 ...
分类:
其他好文 时间:
2021-01-02 11:23:24
阅读次数:
0
public static void main(String[] args) throws APIConnectionException, APIRequestException { pushNotice("","baojing","网页内容","网页标题"); } private static f ...
分类:
其他好文 时间:
2021-01-02 11:07:26
阅读次数:
0
图片下载 //练习Thread,实现多线程同步下载图片 public class ThreadTest2 extends Thread{ private String url; private String name; public ThreadTest2(String url,String nam ...
分类:
其他好文 时间:
2021-01-02 10:53:02
阅读次数:
0
排序大家都经常用的吧,下面是个学生类,2 个字段:id[学号],score[分数], public class Stu { //编号 private Integer id; //分数 private Integer score; public Stu(Integer id, Integer scor ...
分类:
编程语言 时间:
2021-01-01 13:00:11
阅读次数:
0
this关键字代指当前对象,可在方法中区分全局变量和局部变量 public class ThisTest { private int age; public ThisTest(){ System.out.println("我是空参"); } public ThisTest(int age){ thi ...
分类:
其他好文 时间:
2021-01-01 12:56:30
阅读次数:
0