When JUnit testing with exceptions, which of the following is true? Group of answer choices   A successful test happens whenever an exception is not thrown. Exceptions and tests should not be used together. A failed test results when you catch an exception on valid input. If you give an illegal argument to a method the JUnit test will fail.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Q#

 

When JUnit testing with exceptions, which of the following is true?

Group of answer choices

 

  1. A successful test happens whenever an exception is not thrown.
  2. Exceptions and tests should not be used together.
  3. A failed test results when you catch an exception on valid input.
  4. If you give an illegal argument to a method the JUnit test will fail.

 

Q#

 

When you want a method to return nothing, what do you put for the return type?

Group of answer choices

  1. boolean
  2. false
  3. void
  4. null

 

 

Q#

 

Which of the following statements are true?

Group of answer choices

  1. All of the options are true.
  2. Methods can take multiple primitives as arguments.
  3. Methods can take objects of other classes as arguments.
  4. A method for a class can take an object of that class as an argument.

 

 

 

Q#

 

What does Java guarantee is part of every class?

Group of answer choices

  1. AtoString() 
  2. A set of Getter methods to retrieve class variables.
  3. A method to get the binary representation of the class.
  4. A set of private class variables.

 

 

Q#

 

What of the following is true?

Group of answer choices

  1. A constructor is optional for most classes.
  2. A method is not a term used in Java, instead we use the term function.
  3. A constructor is for the creation of a new instance of an object, and a (non-static) method is for carrying out an operation involving an existing object.
  4. A constructor is part of an object class, while a method is defined outside of a class but will take objects as parameters.

 

 

 

                

 

Q#

 

Assume you are using a method that can throw an exception. In order to properly handle the cases when that exception is thrown what is best to use in your code?

Group of answer choices

 

  1. JUnit tests to see if the exception is thrown.
  2. Use a play-grab block.
  3. Use a try-catch block.
  4. Exceptions are not possibly to recover from.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education