What is a driver class? (Java)

lfaraone picture lfaraone · Apr 19, 2009 · Viewed 79.8k times · Source

I was reading through a Java textbook, and it mentions something called a "driver class". What is it, and how is it different from a normal class?

Answer

Stefan Kendall picture Stefan Kendall · Apr 19, 2009

A "Driver class" is often just the class that contains a main. In a real project, you may often have numerous "Driver classes" for testing and whatnot, or you can build a main into any of your objects and select the runnable class through your IDE, or by simply specifying "java classname."