
本文共 4545 字,大约阅读时间需要 15 分钟。
System������������������������������
System���������������������
��������� | ������������ |
---|---|
static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length) | ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ |
static long currentTimeMillis()} | ��������������������������������������������������������������������������������������������������������������������������������������� |
static void gc() | ������JVM������������������������������������������������������������������������������������ |
static void exit(int status) | ������������JVM���������status���������0������������������������0��������������������������������������������������������������������� |
System���������������������
���������������������������������System���������������������������������������������������������������
public class TestSystem { public static void main(String[] args) { // ������arraycopy������������������������ int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9}; int[] dest = new int[8]; // ������������������5������������������������ System.arraycopy(arr, 1, dest, 1, 5); // ������������arr������1������dest������1���������������5 // ������������������������������������ for (int value : dest) { System.out.println(value); } // ������������������ long beginTime = System.currentTimeMillis(); // ������������������������������������������ for (int i = 0; i < 99999999; i++) { for (int j = 0; j < 99999999; j++) { int sum = i + j; } } long endTime = System.currentTimeMillis(); System.out.println("���������������" + (endTime - beginTime) + "ms"); // ������������������������ // ������������������������������������ new TestStudentSystem("aaa", 123); new TestStudentSystem("bbb", 123); new TestStudentSystem("ccc", 123); // ������������������������ // ���������������������gc��������������������������������� // ������������������gc������������������������������������ System.out.println("������������������������������������"); System.exit(0); // ������������JVM������������������������������������ }}
������������������������������������������������������������������������������������������������������������������������������System.exit(0)
������������������������������������������������������������������
TestStudentSystem������������������������������
TestStudentSystem������������������Student������������������������������������������������������������������������������������������������������
public class TestStudentSystem { private String name; private int age; public TestStudentSystem(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public int getAge() { return age; } public void setName(String name) { this.name = name; } public void setAge(int age) { this.age = age; } public TestStudentSystem() { } @Override public String toString() { return "TestStudentSystem{" + "name='" + name + '\'' + ", age=" + age + '}'; } protected void finalize() throws Throwable { System.out.println(name + "������������"); }}
���������������������������������������������������������������������������������������������������TestStudentSystem���������������������������������������������������������������������
������������������������������������������������������������������������
���������������������������������������������������������������������������������System.gc()
������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
