Template:Java Code File

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Java Example
Copy friendly
Code goes here
Template documentation[edit] [history] [purge]

Optimized version of the code template, specialized for Java Programming examples.

Usage[edit source]

Based around Template:code, but with a few of the defaults changed so it's optimised for the purpose of Java examples, all that's really needed is the title and code:

{{Java_Code_File
| header=JavaExample.java
| source=
Class JavaExample {
    public static void main(String[] args)
    {
        System.out.println("Hello, World!");
    }
}
}}

This will look like this:

JavaExample.java
Class JavaExample {
    public static void main(String[] args)
    {
        System.out.println("Hello, World!");
    }
}
Copy friendly
Class JavaExample {
    public static void main(String[] args)
    {
        System.out.println("Hello, World!");
    }
}