Java Flashcards
java: to write a comment type
//
java: java filenames end with
.java
java: Java is a
compiled language
java: a compiled language is one that
must be converted from human readable code to computer readable code before running.
java: javac is short for
java compiler
java: To run a java file that you have already compiled you type
java Filename
java: To compile a java file and then run it, type
javac Filename.java double ampersand
java Filename
java: Variables in java require you to
specify their type
java: To create a string variable, type
String myString = “string”;
java: To print a string with a variable in it to the console, type
console.printf(“I’m %s”, “Alen”)
java: do not forget
to end lines with a semicolon
java: To accept a user input into the console into a variable, type
String myString = console.readLine(“string”);
java: a multi line comment is denoted with
/* */
java: Java’s variable types are
int
String
boolean
java: To write a conditional statement, type
if (10 == 10) {
}
java: The global object that controls the system is called
System
java: To make the system object exit, type
System.exit(0);
System: Any exit code other than 0 means
that the program exited abnormally.
System: an exit code of 0 means
that the program exited intentionally.
java: To convert a string to an int, type
Integer.parseInt(intString);
java: To return a boolean of whether a string variable is the same as another string, type
myString.equals(“string”);
java: To return a boolean of whether a string variable is the same as another string case insensitive, type
myString.equalsIgnoreCase(“string”);
java: the “or” character for conditional statements is
||
java: the “and” character for conditional statements is
double ampersand