File Extension
Java files must use the.java extension:
Compilation
Java files are compiled usingjavac with the following command:
Compilation Options
-d .qt/- Specifies the output directory for compiled.classfiles
.qt/ directory to keep your workspace clean.
Execution
After compilation, the bytecode is executed with:Execution Options
-cp .qt/- Sets the classpath to the.qt/directory where compiled classes are locatedMain- The name of the class containing themainmethod
Example Code
Here’s a typical Java solution for competitive programming:Usage with Quick Test
Compare Mode (cmp)
Compare your solution against a brute-force correct solution:Stress Testing Mode
Test your solution’s performance:Checker Mode
For problems with multiple valid answers:Requirements
Verify your installation:Naming Conventions
For Quick Test CLI, the main solution file is typically named
Main.java with the class public class Main.- Correct solution:
Correct.javawithpublic class Correct - Generator:
Gen.javawithpublic class Gen - Checker:
Checker.javawithpublic class Checker
Common Imports
For competitive programming in Java, you typically need:Platform Support
- Linux: Full support
- Windows: Full support
- macOS: Full support