欢迎来到求知题库网 求知题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

public class ItemTest { 
private final mt id; 
public ItemTest(int id) { this.id = id; } 
public void updateId(int newId) { id = newId; } 
public static void main(String[] args) { 
ItemTest fa = new ItemTest(42); 
fa.updateId(69); 
System.out.println(fa.id); 
} 
} 
What is the result?() 

    A. Compilation fails.
    B. An exception is thrown at runtime.
    C. The attribute id in the Item object remains unchanged.
    D. The attribute id in the Item object is modified to the new value.
    E. A new Item object is created with the preferred value in the id attribute.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题