Friday, 22 August 2008

Java: Display Java code in HTML

It was rather difficult to find a utility for Java code export to HTML but at last I found a free tool called Java Code Export which do a decent job but requires some manual steps after a conversion, why I am not 100% satisfied with this solution. Any tips are welcome in this subject.

For formating testing purposes I publish this tiny Java method for creating random numbers:

     /**

     *

     * @param lowerLimit

     * @param upperLimit

     * @return A random integer number between lowerLimit and upperLimit

     */

    static int createRandomNumberInt (int lowerLimit, int upperLimit)    {

        Random generator = new Random();

        return generator.nextInt (upperLimit-lowerLimit) + lowerLimit;

    }

1 comment:

Sigmund M. Nilssen said...

Thank you! Was looking for something like this. Like you say, it's not perfect, but it's a lot better than nothing.