Multiple Choice
Consider the partial JUnit test below, designed to test a class that keeps a count: @Test public void twoIncrements()
{
Counter ctr = new Counter(10) ;
Ctr) increment() ;
Ctr) increment() ;
// Put test line here
}
Which line will test that the resulting value is 12?
A) Assert.assertEquals(12, ctr.getValue() ) ;
B) Assert.assertEquals(ctr.getValue() ) ;
C) System.out.println(12 == ctr.getValue() ) ;
D) if (12 == ctr.getValue() ) { System.out.println("Passed") ; } else { System.out.println("Failed") ;}
Correct Answer:

Verified
Correct Answer:
Verified
Q22: Which class category has static methods and
Q24: Which of the following is an example
Q42: To use a public variable or method
Q43: Which of the following does NOT describe
Q44: When are statements in a class-level initialization
Q79: Which class does not require an import
Q80: Which annotation is used to mark test
Q81: Consider the partial Date class below which
Q85: Which statement will import the static methods
Q88: Which of the following is not accomplished