public class StringUtils extends org.apache.commons.lang3.StringUtils { public static final String[] BLANK=new String[]{""," "," "," "," "}; /** * 合并字 ...
分类:
其他好文 时间:
2020-12-09 11:34:32
阅读次数:
5
class Solution { public: bool isPossible(vector<int>& nums) { unordered_map<int, int> numsCntMap;//numsCntMap[num]表示的是num剩余的个数 unordered_map<int, int> ...
分类:
编程语言 时间:
2020-12-09 11:33:26
阅读次数:
7
Java类的访问权限 Java类的访问权限有两种: 公共类和非公共类 使用public修饰的类为公共类,没有使用public修饰的类为非公共类。 公共类的应用场景 如果这个类想要在其他包中使用就定义为公共类 非公共类只能在当前包中使用 在定义类的成员时,遵循访问权限最小化的原则。 如果想在任意位置都 ...
分类:
编程语言 时间:
2020-12-08 12:45:11
阅读次数:
8
首先还是一些类型转换方面的知识 1 public class demo5 { 2 public static void main(String[] args) { 3 int i = 128; 4 byte b =(byte)i;//内存溢出 5 6 //强制转换 (类型)变量名 高 低 7 //自 ...
分类:
其他好文 时间:
2020-12-08 12:25:02
阅读次数:
4
1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional ...
分类:
编程语言 时间:
2020-12-08 12:13:52
阅读次数:
7
用法一 this代表当前类的实例对象 namespace Demo { public class Test { private string scope = "全局变量"; public string getResult() { string scope = "局部变量"; // this代表Tes ...
线程安全 学习材料来源于网络 如有侵权,联系删除 竞态条件与临界区 public class Demo { public inti= 0; public void incr(){ i++; } } 多个线程访问了相同的资源,向这些资源做了写操作时,对执行顺序有要求。 临界区: incr方法内部就是临 ...
分类:
编程语言 时间:
2020-12-07 12:35:52
阅读次数:
7
1、利用stream对数据进行分组并求和 public static void main(String[] args) { List<String> items = Arrays.asList("apple", "apple", "banana", "apple", "orange", "banan ...
分类:
编程语言 时间:
2020-12-07 12:34:17
阅读次数:
8
一,表示类中属性 1,没有使用this的情况 class Person{ // 定义Person类 private String name ; // 姓名 private int age ; // 年龄 public Person(String name,int age){ // 通过构造方法赋值 ...
分类:
编程语言 时间:
2020-12-07 12:33:13
阅读次数:
8
直接新建个文件即可 ExLogic.cs public class ExLogic { #region 对象转成字典 /// <summary> /// 对象转换为字典 /// </summary> /// <param name="obj">待转化的对象</param> /// <returns> ...
分类:
其他好文 时间:
2020-12-07 12:20:51
阅读次数:
7