JUnit Interview Questions Part II

How To Compile a JUnit Test Class?

Compiling a JUnit test class is like compiling any other Java classes. The only thing you need watch out is that the JUnit JAR file must be included in the classpath. For example, to compile the test class HelloTest.java described previously, you should do this:

The compilation is ok, if you see the HelloTest.class file.

How To Run a JUnit Test Class?

A JUnit test class usually contains a number of test methods. You can run all test methods in a JUnit test class with the JUnitCore runner class. For example, to run the test class HelloTest.java described previously, you should do this:

This output says that 1 tests performed and passed.

Learn more about JUnit

List any five features of Java?
  • Robust

  • Secure

  • High Performance

  • Multi-threaded

  • Interpreted

How Java enabled high performance?

Java enabled High performance by introducing Just-In-Time compiler.

What do you know about Java?

Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

Java runs on which ux?

Java runs on ux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS, etc.