Java Flashcards
what is the Java equivalent to DISPLAY?
System.out.println(…);
how do you display a String?
“___”
how do you compile a code?
javac (class name).java
how do you execute a code?
java (class name)
how do you make a comment?
// your comments here
what are the types of variables?
char String boolean int double
how do you write character types?
char x = ‘A’;
how do you write strings?
String “example”;
how do you write integers?
int exampleOne = 3;
how do you start a code?
public class (class name){ public static void main(String[] args){ // code here } }
what are the primitive data types?
char
boolean
int
double
what is camel-case?
start variable with a lowercase and then every new word starts with a capital letter
what are the compound assignment operators?
\+= (adds to variable) -= (subtracts from variable)
how do you turn an argument from a string into an integer or a double?
Integer.parseInt (args [0] )
Double.parseDouble [args [1] )
how do you write and, or, and not?
&&
||
!