public class Abc { public static void main(String[] args) { int a=2, b=Integer.MAX_VALUE; System.out.println(a*b); } }
Compile it, then instrument the Abc.class file with Cojac: java -jar cojac-0.91.jar Abc.class
Execute the instrumented file COJAC_Output\Abc.class.
It will generate at runtime a log file Abc_COJAC_Report.log saying:COJAC: Overflow: IMUL Abc.main(Abc.java:4)