Inline Java code
/**
* This is a Java "Hello world" example.
* @param args arguments
*
* @since 1.3
*/
public class Test {
public static void main(String[] args) {
System.out.println("Hello World!"); (1)
}
}
-
This is where the fun happens
Included Groovy code (from code_snippets/groovy.groovy)
link:code_snippets/groovy.groovy[role=include]
Inline Scala code
/**
* This is a simple scala example
*/
object HelloWorld {
def main(args: Array[String]) {
println("Hello, world!")
}
}
Inline HTML code
<HTML>
<head>
<title>
A Small Hello
</title>
</head>
<body>
<h1>Hi</h1>
<div class="hello">This is very minimal "hello world" HTML document.</div>
</body>
</HTML>
Inline JavaScript code
if (console.log) {
// greeting silently
console.log('Hello World!!')
} else {
// greeting in a pop up window
alert('Hello World!')
}