1/27
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
a final variable
A final variable is a variable that cannot be changed once it is assigned a value. It is typically used to represent constants in a program. it can be accessed with an accessor method, meaning its declared from the method. SYNTAX EXAMPLE: Object.method()
a static final variable
a static final variable is a variable that cannot be changed once assigned a value. It can be accessed without the need for an accessor method, so it's declared from the class. when used as an instance variable, the access specifier would be public. SYNTAX EXAMPLE: Class.method()
overflow
overflow occurs when the result of a calculation exceeds the range for a number type. ex, when trying to solve an overflow with the int type, use long instead
rounding errors
Mistakes that occur when approximating a number. They happen due to limitations in representing real numbers in a computer's finite memory. Rounding errors can accumulate and affect the accuracy of calculations.
primitive types
Basic data types in programming languages. Include integers, floating-point numbers, characters, and booleans. Represent simple values and have predefined sizes. Stored directly in memory and accessed quickly. Cannot be further divided or modified. Examples: int, float, char, bool.
number literals
Numeric values used to represent specific numbers in programming. They can be written directly in the code without any calculations or variables. Examples include integers (e.g., 5), floating-point numbers (e.g., 3.14), and exponential notation (e.g., 1e3 for 1000).
square root method in a Math class
Math.sqrt(x). Mathematical Representation: square root of x
power method in a Math class
Math.pow(x, n). Mathematical representation: x^n
When I divide by a demical, the result doesnt have to be a decimal: true or false?
false
when I divide by an integer, the result would be an integer: true or false
true
the % operator in java
Java operator used to calculate the remainder of a division operation. Returns the remainder when one number is divided by another.
I can initialize an int with a double: true or false?
false
static methods
methods that can be declared with no need of an object reference. EXAMPLE: Class.method()
Prompt
a print message that prompts the user on what to place in the import
the statement for the prompt could be println or printf, it doesn't always have to be print: true or false?
false
System.in
takes in input from the user. can be combined with the Scanner class to be useful
Scanner Object SYNTAX
Scanner in = new Scanner(System.in);
nextInt method
reads a int imput
NextDouble method
reads a float-point value
Next method
reads a string with a single word, not multiple
the best way to format a numerical answer would use what print statement?
the printf statement
string
A sequence of characters
character
a value of the type char
Single quotes are for _____ while double quotes are for ______
Char; String
The position number of the last character is always ________ than the length of the string
One less
charAt()
Returns the character at the specified index
string literal
text enclosed in quotes
empty string
The string "", which contains no characters and has a length of zero.