1/9
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
class
declares the .java title.
without putting “Public” before it, you are not allowing other programs/files in the project to access it.
public static void main(String[] args) {}
Needed for programs like System.out.println(“Hello World!”);
System.out.println(“Hello World!”);
prints out “Hello World!” to the console.
Double variable = ;
Declares a double (number with decimals included) named variable that has a value of that amount.
int variable = ;
declares an integer (NO DECIMALS) variable named variable.
Boolean variable = ;
can only be true or false
import java.util.Scanner;
needed for user input.
scanner input = new Scanner(system.in);
create scanner object, needs to be declared before the use of input.
input.close();
closes the input scanner. This must be used after the scanner.
double userInput = input.nextDouble();
next input is set to that variable