Typically, in JS, variables are defined using var, let, or const.
For example: var abc 1;
But what if you dont want others to see that youve defined a variable abc? How should you do it?
You can write it like this: this["abc"] 1;
This als…
threadsynchronized
就好像一个圆圈,A->B->C->A。。。。。
synchronized能够保证多个线程进入实,只用一个线程能进入。
/**多线程交替打印* */
public class Task {private final Object lock new Object();private int count 0;public st…
62. 不同路径
class Solution {public int uniquePaths(int m, int n) {int[][] dp new int[m][n];for(int i 0; i < m; i) dp[i][0] 1;for(int j 0; j < n; j) dp[0][j] 1;for(int i 1; i < m; i){for(int j 1; j < n; j){dp[i][j] dp[i - 1][j] dp[i][…
方法(函数)
Java中的方法必须定义在类或接口中。
package day2;import java.util.Scanner;public class way {public static void main(String[] args) {int arr[] new int[5];Scanner sc new Scanner(System.in);for (int i 0; i < arr.length;…