In the code above the setNum is an method and the getNum is

In the code above the setNum is a(n) ______________ method and the getNum is a(n)_________________method

2) When writing a JUnit test, which of the following would be most accurate in correctly testing that two values are the same?

a. assertEquals()

b. assertTrue()

c. try-catch block{}

d. fail()

3) Which of the following will cause a JUnit test to fail?

a. empty test body

b. method return

c. caught exception

d. failed assertion

Solution

Question 1:

Answer: setNum is an abstract method and getNum is also an abstract method.

All methods in an interface are abstract methods. we can not have concrete methods in interface.

Question 2:

Answer:assertEquals()

for comparing two values are same, we have to use assertEquals()

Question 3:

Answer:failed assertion

failed assertion will cause a JUnit test to fail

In the code above the setNum is a(n) ______________ method and the getNum is a(n)_________________method 2) When writing a JUnit test, which of the following wo

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site