69.5k views
0 votes
Rebecca is creating a method for her class, but wants to make sure that a variable in the method satisfies a conditional phrase. If it doesn’t, she wants the method to return an error and stop the program. She also wants to be able to turn this function on and off. What should she use?

A. this()
B. a void method
C. an exception
D. an assertion

1 Answer

3 votes

Answer:

D. an assertion

From PLATO

User One Monkey
by
4.6k points