Question: What is wrong with the following code? x should be given a value of 24. What are two ways this can be legally accomplished? 1
What is wrong with the following code? x should be given a value of 24. What are two ways this can be legally accomplished?
1 public class H2ClassI { 2 final int x; 3 4 public static void main (String args []) { 5 H2ClassI h = new H2ClassI (); 6 h.x = 24; 7 } // end main 8 } // end class H2ClassI
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
