aboutsummaryrefslogtreecommitdiff
path: root/examples/maven/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/maven/src')
-rw-r--r--examples/maven/src/main/kotlin/HelloWorld.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/maven/src/main/kotlin/HelloWorld.kt b/examples/maven/src/main/kotlin/HelloWorld.kt
new file mode 100644
index 00000000..172e18f7
--- /dev/null
+++ b/examples/maven/src/main/kotlin/HelloWorld.kt
@@ -0,0 +1,20 @@
+package demo
+
+/**
+ * This class supports greeting people by name.
+ *
+ * @property name The name of the person to be greeted.
+ */
+class Greeter(val name: String) {
+
+ /**
+ * Prints the greeting to the standard output.
+ */
+ fun greet() {
+ println("Hello $name!")
+ }
+}
+
+fun main(args: Array<String>) {
+ Greeter(args[0]).greet()
+}