Help the world stop coronavirus! Stay home!

Prev Next

JUnit / Junit Interview questions

Differentiate @After and @AfterClass.

@After
public void runAfterEachTest()

This method gets executed after every test and it is used to clean up the test and temporary data that are used by test.

@AfterClass
public static void runAfterAllTheTest()

This method gets executed at the end, when all the tests have completed execution and gets executed only once.

Usually used for closing the database connection.

Method should be declared static.

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

Junit Interview questions III

Comments & Discussions