Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ca cs211 mid-tom exam, Summer 2018 W. P. Ivereon, nateuotor NAN HEON LEE below i

ID: 3917792 • Letter: C

Question

ca cs211 mid-tom exam, Summer 2018 W. P. Ivereon, nateuotor NAN HEON LEE below ia a working should now to think like the computer, and know what output ia produced, ram. You should have aurEleient experience Inatruot iona: Write expected output for each numbered 1ine below, or writ s pointa per numbered item * code as instrueted. . In rare cases, an object has no usetul tostring 0 write HEX in those can Integer aero-Integer.valueor (o) 1 returna Integer(0) object Integer tive-Integer,valueor (5) replaces depricated Integer (5) Integer negativesixInteger.valueor (-6)a 1/ see above // starting with some hopefully easy thinga to tigure out: System.out.printin(5 -6)2 1 1. False System.out printin(tive. compareTo (negativesix)) System.out.printIn(five-negatives ??); System.out.printin(five.equals (negativesix)) System.out printin(zero.compareTo (Eive)) 1 3. 14. // Questions using ArrayList ArrayList exam - new ArrayListcInteger> System.out.printin (exam) System.out.printin (exam.sizeO) 11 7? exam. add (zero) exam.add (five) exam.add (negativesix) exam. add (zero): exam.add (five) exam.add (negativesix): System.out-printin (exam.get (2)) System.out.printin (exam.sizeO) 18 exam. set (2,2) System.out.printin (exam.get (2)) System.out.printin (exam.size O) exam. add (2,-6) System.out.printin (exam.get (2)) exam. remove (Integer.valueof (1)) System.out.printin (exam.size 0); 1 13. exam. remove (1): System.out.println (exam.size)): System.out.println (exam.add (2))

Explanation / Answer

Answering first four questions

1. false

2. 1 (compare to returns 1 is left hand operand is greater than right hand)

3. false (== returns true only if both references points to same object)

4. false ( compares value and data type of the two operands)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote