摘要:
又叫做静态工厂方法(StaticFactory Method)模式,但不属于23种GOF设计模式之一。 简单工厂模式的实质是由一个工厂类根据传入的参数,动态决定应该创建哪一个产品类。 Spring中的BeanFactory就是简单工厂模式的体现,根据传入一个唯一的标识来获得Bean对象,但是否是在传 阅读全文
posted @ 2021-01-06 17:55
LinYanyan
阅读(155)
评论(0)
推荐(0)
摘要:
public static void main(String[] args) { for(int year = 1000;year ⇐ 2000;year++){ if((year % 4 == 0 && year % 100 != 0) || year % 400 ==0){ System.out 阅读全文
posted @ 2021-01-06 17:53
LinYanyan
阅读(816)
评论(0)
推荐(0)
摘要:
1、https协议需要到ca申请**,一般免费**较少,因而需要一定费用。 2、http是超文本传输协议,信息是明文传输,https则是具有安全性的ssl加密传输协议。 3、http和https使用的是完全不同的连接方式,用的端口也不一样,前者是80,后者是443。 4、http的连接很简单,是无状 阅读全文
posted @ 2021-01-06 17:52
LinYanyan
阅读(2641)
评论(0)
推荐(0)
摘要:
public static void main(String[] args) { int count = 0; for (int i = 1; i < 100; i++) { if(i % 10 == 9) { count++; }else if(i / 10 == 9) { count++; } 阅读全文
posted @ 2021-01-06 17:50
LinYanyan
阅读(142)
评论(0)
推荐(0)
摘要:
public static void main(String[] args) { int a = 4; int b = 2; int c = 3; int max = 0; int min = 0; if (a > b && a > c) else if (b > a && b > c) else 阅读全文
posted @ 2021-01-06 17:48
LinYanyan
阅读(189)
评论(0)
推荐(0)
摘要:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); 阅读全文
posted @ 2021-01-06 17:47
LinYanyan
阅读(224)
评论(0)
推荐(0)
摘要:
switch中的值只能是整数、枚举、字符、字符串 不可使用long、float、double、boolean作为它的数据类型 阅读全文
posted @ 2021-01-06 17:45
LinYanyan
阅读(294)
评论(0)
推荐(0)
摘要:
分为单行注释,多行注释(块注释),文档注释 注释可以提高代码可读性,方便后期代码维护, 方便程序员间的交流沟通生成帮助文档。 同时注释不能长篇大论,也不能过于简单。 阅读全文
posted @ 2021-01-06 17:44
LinYanyan
阅读(66)
评论(0)
推荐(0)
摘要:
+= 将该运算符左边的数值加上右边的数值, 其结果赋值给左边变量本身 -= 将该运算符左边的数值减去右边的数值, 其结果赋值给左边变量本身 *= 将该运算符左边的数值乘以右边的数值, 其结果赋值给左边变量本身 /= 将该运算符左边的数值整除右边的数值, 其结果赋值给左边变量本身 %= 将该运算符左边 阅读全文
posted @ 2021-01-06 17:43
LinYanyan
阅读(417)
评论(0)
推荐(0)
摘要:
关于Collection接口方面百度的技术面试主要问题: Collection有哪些子类或者子接口(上面图即是常用的); 问:接口可以定义常量么? 答:接口肯定是可以定义常量的,并且只能定义常量,但是其实接口中定义公有常量是不推荐的,除非这个常量与这个接口及其实现的子类有非常密切的关系,如integ 阅读全文
posted @ 2021-01-06 17:41
LinYanyan
阅读(700)
评论(0)
推荐(0)
浙公网安备 33010602011771号