synchronized synchronized的作用范围 public class SynchronizedTest { // 实例方法,方法访问标志ACC_SYNCHRONIZED,锁对象是对象实例 public synchronized void test1(){} // 静态方法,方法访问 ...
分类:
其他好文 时间:
2020-12-22 13:12:26
阅读次数:
0
分析: 1.指定GBK编码的转换流,读取文本文件。InputStreamReader 2.使用UTF-8编码的转换流,写入到文本文件中。OutputStreamWriter 代码示例 public class Demo01 { public static void main(String[] arg ...
分类:
其他好文 时间:
2020-12-22 13:10:32
阅读次数:
0
学习内容 1、定义一个基类Base,有两个公有成员函数fn1(),fn2(),私有派生出Derived类,如何通过Derived类的对象调用基类的函数fn1() 1 //基类: 2 public class Base { 3 public void fn1() { 4 System.out.prin ...
分类:
其他好文 时间:
2020-12-22 12:57:39
阅读次数:
0
测试TestTcp请求 处理Socket,代码如下: #region 测试TestTcp /// <summary> /// 测试TestTcp /// </summary> public static async void TestTcp() { var threadStart = new Thr ...
分类:
其他好文 时间:
2020-12-22 12:32:26
阅读次数:
0
前因: 被自动续费的服务器搁置没用, 所以打算搞一个jupyter notebook放到上面 服务器被恶意登录, 虽然没有登录上但是还是很不爽 过程 修改/etc/ssh/sshd_config中的Port, 改成新的端口 重启network, 发现不生效 重启sshd服务, 发现服务重启失败 关闭 ...
分类:
其他好文 时间:
2020-12-22 12:28:21
阅读次数:
0
Java如何让自己写的代码生成帮助文档 对写的java代码加文档注释下: public class HelloWord{/***@author yang*@param args helloword*@since 1.0*/public static void main(String[] args){ ...
分类:
编程语言 时间:
2020-12-22 12:07:16
阅读次数:
0
getFields():获得某个类的所有的公共(public)的字段,包括父类中的字段。 getDeclaredFields():获得某个类的所有声明的字段,即包括public、private和proteced,但是不包括父类的申明字段。 同样类似的还有getConstructors()和getDe ...
分类:
其他好文 时间:
2020-12-22 12:01:59
阅读次数:
0
//动态规划 class Solution { public int nthUglyNumber(int n) { //定义一个数组dp,来按序存放丑数 int[] dp = new int[n]; //第一个丑数是1 dp[0] = 1; //分别定义由质因子 2,3,5 乘以较小丑数得到的下标索 ...
分类:
其他好文 时间:
2020-12-21 12:11:13
阅读次数:
0
复习bfs 这题我们用bfs 做 class Solution { public: int numSquares(int n) { queue <int> q; vector <int> dist(n+1,INT_MAX); q.push(0); dist[0] = 0; while(q.size( ...
分类:
其他好文 时间:
2020-12-21 12:01:05
阅读次数:
0
template <class T> class heap { vector<T>data; public: heap() {} heap(T *a,int len) { for (int i = 0; i < len; i++) data.push(a[i]); } T top() { retur ...
分类:
其他好文 时间:
2020-12-21 11:58:03
阅读次数:
0