var removeDuplicates function(s) {//设置一个空数组来储存一个字符串let stack [];//使用 for...of 循环遍历字符串 s 中的每一个字符,当前字符存储在变量 v 中for(v of s){//从栈顶弹出一个元素(即最后一个压入的元素),存储在…
以下static可以输出运行结果
public class Nr{static int x;public static void main(String[] str){Nr.x 3;Nr nr new Nr();nrnull;System.out.println(nr.x);}
}
static int x; x 是一个静态变量,属于类 Nr,不属于某个具体对象。 静态变量的内存分…