Object Oriented Programming (OOPs)

© examsiri.com
Question : 39 of 72
 
Marks: +1, -0
Given:
1. public class ItemTest {
2.   private final int id;
3.   public ItemTest(int id) { this.id = id; }
4.   public void updateId(int newId) { id = newId; }
5.
6.   public static void main(String[] args) {
7.    ItemTest fa = new ItemTest(42);
8.    fa.updateId(69);
9.    System.out.println(fa.id);
10.   }
11. }

What is the result?
Go to Question: