Java compile command?
javac
What is compiler command for setting the compile output directory?
-d
How does typical compile command look like? What are its parts?
How to set classpath location while using compiler command and all its variants?
-cp
-classpath
–class-path
How to run Java application using CLI?
java
What do you need to provide “java” command to run Java application?
Package path to class that has main method we want to run, and complete classpath
How do text block look like?
”””
text block”””
Note: it needs to have first line below opening quotes!
In text blocks, how do we request a new line in output?
\n
In text blocks, how do we request not to add a new line?
\
In text blocks, how do we escape characters?
\ and some character
eg. "
In text blocks, how do we request two spaces in output?
\s
What is command to JAR a Java application?
jar
How do we choose dependency folder while using “jar” command?
-c
How do we JAR a Java application?
jar -cvf JarName.jar -c dependency/folder .
What is alternative to “-cvf”
–create –verbose –file
What do we need to watch out when using imports?
We need to look for imports with the same name
What are rules when using wildcard * in imports?
What are rules when naming identifiers?
What are rules for local variables?
They must be initiated before use
Where can “var” be used?
Only with local variables
What is rule when using “var”?
Its value must be set in the same line as var, not later
Is “var” reserved keyword?
No, it can be used as identifier - var var = new Var();
public int addition(var a, var b)?
var cannot be used as parameter as parameters are not local variables
What is rule for initialization of variables in same line?
Only one variable type can be defined per line - int a, b, c = 5