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.
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
Related questions
Question
Q#
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.
Q#
When you want a method to return nothing, what do you put for the return type?
Group of answer choices
- boolean
- false
- void
- null
Q#
Which of the following statements are true?
Group of answer choices
- All of the options are true.
- Methods can take multiple primitives as arguments.
- Methods can take objects of other classes as arguments.
- 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
- AtoString()
- A set of Getter methods to retrieve class variables.
- A method to get the binary representation of the class.
- A set of private class variables.
Q#
What of the following is true?
Group of answer choices
- A constructor is optional for most classes.
- A method is not a term used in Java, instead we use the term function.
- 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.
- 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
- JUnit tests to see if the exception is thrown.
- Use a play-grab block.
- Use a try-catch block.
- Exceptions are not possibly to recover from.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education