True or False: There is no way to use JUnit to test whether a method correctly throws an exception. Exceptions thrown by

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

True or False: There is no way to use JUnit to test whether a method correctly throws an exception. Exceptions thrown by

Post by answerhappygod »

True or False: There is no way to use JUnit to test whether a
method correctly throws an exception. Exceptions thrown by the
method being tested will always cause the JUnit test to fail.
Choice 1 of 2:True
Choice 2 of 2:False
Consider implementing two tests for inserting into a Hash Table
that uses a linear probing collision resolution strategy and the
modulo hash function (i.e. key % M where M is the size of the hash
table).
Your first test creates a hash table of size 11, inserts the
elements 13, 15 and 19, and then checks to ensure that the elements
are in the correct location in the array.
Which of the following tests is the best choice for your second
test?
Choice 1 of 3:Create a hash table of size 13 and insert 17, 15
and 1
Choice 2 of 3:Create a hash table of size 11 and insert 15, 25,
13 and 30
Choice 3 of 3:Create a hash table of size 11 and insert 3, 14,
and 4
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply