Intro to Java Flashcards
Find the length of a string
.length
Make a note that the computer ignores
//
Ask the user to say yes or no
confirm()
Request in input from the user
prompt()
What is a string?
Letters, spaces, numbers
””
What are the boolean values?
True or False
prints to the console
console.log()
Greater Than
>
Less Than
<
Less than or equal to
<=
Greater than or equal to
> =
Equal to
===
Not equal to
!==
Syntax of an “if” statement
if()
{
code
}
Syntax of an “If else” statement
If() { code } else { code }
%
Modulo
divides the first operator by the second operator and gives the remainder
How do you return a substring?
“string”.substring(X,Y)
The variables are numbers
X = the beginning of the substring
Y = the end of the substring
The first “cut” is to the left of the first character. Counting starts at “0”.
How do you declare a variable?
var varName = data type
variable names are case sensitive
What kinds of scope are there?
Global scope
Local scope
Global scope
A variable declared outside a function can be accessed anywhere once declared.
Local scope
A variable defined inside a function is local and cannot be accessed outside the function.
JDK
Java Development Kit
The software for developers who want to write Java programs.
The software for developers who want to write Java programs
JDK
Java Development Kit
JRE
Java runtime environment.
The software for consumers who want to run Java programs. Contains the virtual machine but not the compiler.