Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please help me with these questions? Thank you. 1) Suppose a method has a parameter int[] a. Suppose further than we either: clone

Can someone please help me with these questions? Thank you.

image text in transcribed

1) Suppose a method has a parameter int[] a. Suppose further than we either: clone a int[] b=a. clone(): copy a int[] b =a : Then match each of the following statements against when they are true: a) b has the same length as a b) the code could throw an exception c) if you assign b[2]=19; then a [2] changes too d) b[0]!=a[0] a) true after copy a, but not after clone a b) true after either copy a or clone a c) true for clone a, but nor for copy a d) not true after either copy a or clone a 2) One of the methods is addBefore. What are good boundary situations to test this method on? Check all that apply. a) An empty sequence b) When there is no current element but several elements c) When the first element is current d) When there current element is in the middle of several elements 3) Which of the following statements about OutOfMemoryError is true? a) Programmers should catch this exception and choose a more space-efficient algorithm instead. b) Java requires that any method that might throw it to declare this possibility. c) It can happen if we access an array element at a very high index. d) It can happen in any method creating a new array. e) It can happen if you create an array of length greater than Integer.MAX VALUE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

How We Listen?

Answered: 1 week ago