Print Statements
Learn about the different print statements here.
println()
: Theprintln()
command is the most basic and arguably the most used statement in JVM languages like Java, Kotlin and Cylvre. For languages like Kotlin and Cylvre,println()
compiles down to the bytecode equivalent ofSystem.out.println()
in Java. It is a function that prints the desired output and adds a new line character\n
at the end.
Example
print()
: Theprint()
command is more or less the same asprintln()
, but without the new line character insertion. In JVM languages like Kotlin and Cylvre, it compiles down to the bytecode equivalent ofSystem.out.print()
in Java. While the above example prints "Hello" and "World" on two separate lines, the below example will print them on the same line together, unless a space is explicitly declared.
Example
print_err()
: We now come to error printing orstderr
. This function, unique to Cylvre, compiles down to the bytecode equivalent ofSystem.err.println()
in Java. It prints an error and is sometimes highlighted red in some IDEs.
Example
Not to worry about the conditional syntax of Cylvre, it will be explained later.
Last updated