1、what? 值传递: 将实际参数的副本 传递,这样对参数作修改,不会影响到实际参数; 引用传递: 将 实际参数的地址 直接 传递,对参数的修改,影响实际参数; Java中只有 值传递; public class ValueOrReferenceTransferTest { static Stri ...
分类:
编程语言 时间:
2021-06-16 17:32:02
阅读次数:
0
HelloWorld 新建一个文本文档后缀名改为 .java 编写代码 public class Hello{ public static void main(String[] args){ System.out.print("Hello,World!"); } } 编译 javac Hello.j ...
分类:
其他好文 时间:
2021-06-16 17:30:23
阅读次数:
0
public class DoublePointer { public static int[] a = new int[]{1, 3, 4, 9}; public static int[] b = new int[]{0, 3, 4, 4}; public static void main(Str ...
分类:
编程语言 时间:
2021-06-15 18:46:19
阅读次数:
0
在策略模式(Strategy Pattern)中,一个类的行为或其算法可以在运行时更改。这种类型的设计模式属于行为型模式。 public interface Strategy { public int operate(int num1, int num2); } public class AddOp ...
分类:
其他好文 时间:
2021-06-15 18:41:21
阅读次数:
0
class Program { public static long flgVal = 0; static void Main(string[] args) { int n = 100; Task.Run(() => DaMi(n)); Task.Run(() => LaoShu(n)); Cons ...
分类:
编程语言 时间:
2021-06-15 18:31:41
阅读次数:
0
测试类: //测试工厂bean 单多实例 @Test public void test01(){ ApplicationContext context=new ClassPathXmlApplicationContext("503bean5.xml"); MyBean myBean1 = conte ...
分类:
其他好文 时间:
2021-06-15 18:27:08
阅读次数:
0
题目描述 题干: 符合下列属性的数组 arr 称为 山脉数组 : arr.length >= 3 存在 i(0 < i < arr.length - 1)使得: arr[0] < arr[1] < ... arr[i-1] < arr[i] arr[i] > arr[i+1] > ... > arr ...
分类:
编程语言 时间:
2021-06-15 18:16:39
阅读次数:
0
二分寻找边界 public class Solution extends VersionControl { public int firstBadVersion(int n) { int i = 1; int j = n; while (i<=j) { int mid = i + ((j-i)>>1 ...
分类:
其他好文 时间:
2021-06-15 18:12:30
阅读次数:
0
<% page language="java" contentType="text/html; charset=gbk" pageEncoding="gbk"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ".w3. ...
分类:
其他好文 时间:
2021-06-15 17:34:59
阅读次数:
0
hashSet 类图: hashset 本质上为hashMap 的key, 常用于集合去重。 构造函数: public HashSet() { map = new HashMap<>(); } public HashSet(Collection<? extends E> c) { // (int) ...
分类:
其他好文 时间:
2021-06-15 17:33:38
阅读次数:
0