Update Formatting authored by Callum Gran's avatar Callum Gran
...@@ -90,22 +90,24 @@ Examples of labels: ...@@ -90,22 +90,24 @@ Examples of labels:
Example of a function: Example of a function:
`class GenerateRandom {` ```
class GenerateRandom {
`public int generateRandom(int param1, int param2) {` public int generateRandom(int param1, int param2) {
`int min = param1;` int min = param1;
`int max = param2;` int max = param2;
`int random_int = (int)Math.floor(Math.random() * (max - min + 1) + min);` int random_int = (int)Math.floor(Math.random() * (max - min + 1) + min);
`return random_int;` return random_int;
`}` }
`public static void main( String args[] ) {` public static void main( String args[] ) {
`System.out.println(generateRandom(10, 40));` System.out.println(generateRandom(10, 40));
`}` }
`}` }
```
- Tabwidth is 2 spaces. - Tabwidth is 2 spaces.
- Newline before return sequence, unless it is a oneliner. - Newline before return sequence, unless it is a oneliner.
... ...
......