java软件开发工程师笔试题
- 考研
- 关注:8.57K次
1:
In the following code, which is the earliest statement, where the object originally held in e, may be garbage collected:
ic class Test {
2. public static void main (String args []) {
3. Employee e = new Employee("Bob", 48);
4. ulatePay();
5. tln(tDetails());
6. e = null;
7. e = new Employee("Denise", 36);
8. ulatePay();
9. tln(tDetails());
10. }
11.}
Only One:
In the following code, which is the earliest statement, where the object originally held in e, may be garbage collected:
ic class Test {
2. public static void main (String args []) {
3. Employee e = new Employee("Bob", 48);
4. ulatePay();
5. tln(tDetails());
6. e = null;
7. e = new Employee("Denise", 36);
8. ulatePay();
9. tln(tDetails());
10. }
11.}
Only One:
10
11
7
8
2:Exhibit :
1. public class test (
2. private static int j = 0;
3.
4. private static boolean methodB(int k) (
5. j += k;
6. return true;
6. )
- 文章版权属于文章作者所有,转载请注明 https://m.leqiuxue.com/kywx/geeywd.html