“I acknowledge that my instructor is requiring during ALL EX…

“I acknowledge that my instructor is requiring during ALL EXAMS that my webcam be set up at a sufficient location and distance to show my workspace, face, and hands at all times.  I understand that written notes will always be acceptable to use during the exam, but NO outside electronic devices (tablet, phone, second monitor/computer, etc) are to be used during the exam.”   If your webcam is not setup to show your full workspace, face, and hands during each exam, or if you use outside devices to assist in answering questions, your exam will not be graded and you will receive a 0.  If it occurs more than once, you will receive an F in the course and the violation will be reported in a Student Incident Report, which will be turned into the college.

First, note that int is immutable. Is the class below mutabl…

First, note that int is immutable. Is the class below mutable or immutable? If mutable: a) provide client code that will mutate it; and b) provide an immutable version of it (your solution has to be minimal, i.e., make the minimal changes possible, or you might loose points). If immutable, provide a convincing argument why it is so.   final class SomeClass {     private final int n;         public SomeClass(int n) {         this.n = n;                                   }     public int getInt()    { return n; }   }

Describe the observed behavior below. (pick one)            …

Describe the observed behavior below. (pick one)               public static void main(String[] args) {                                         foo1();               }               public static void foo1()  {                              try {                                            throw new RuntimeException();                              } finally {                              }               } Compiler error Runtime error No error – prints nothing  

Describe the observed behavior below. (pick one)            …

Describe the observed behavior below. (pick one)               public static void main(String[] args) {                                        foo1();               }               public static void foo1()  {                              throw new RuntimeException();               } Compiler error Runtime error No error – prints nothing

       Describe the observed behavior below (pick one).     …

       Describe the observed behavior below (pick one).        public static void main(String[] args) {                                         foo1();               }               public static void foo1()  {                              throw new Exception();               } Compiler error Runtime error No error – prints nothing

Given the function find() which is implemented based on Spec…

Given the function find() which is implemented based on Spec1. Could find() be reimplemented based on Spec2? If yes, explain why. If no, explain why not.   int find(int[] a, int val)    Spec1:   requires: val occurs exactly once in a   effects:  returns lowest index i such that a[i] = val   Spec2:   requires: val occurs at least once in a                     effects:   returns index i such that a[i] = val