1/32
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
getMessage()
This method can be used to retrieve the error message from an exception object
InputMismatchException
In Scanner methods, if the token read doesn't match the expected data type then this exception is thrown.
IOException
A type of Run-time error or exception that can occur while performing certain Input or Output operations- usually when there is a problem with the file
getStackTrace
Returns an array of stack trace elements
primitive data types
pre-defined java information ( int, boolean, double, char, float, long, byte, etc.)
Wrapper class
Converts primitive data types into objects
"Try" block
Used around code being attempted
"Catch" block
Catches exceptions and displays their information
"Finally" block
Always executes; after try and catch blocks
Public
Can be accessed by any class in a block of code
Static
Allows for a method to be called without instantiating the class in which it resides
Protected
Data can be modified or accessed by classes that share the same package or any subclass
Private
only accessible if in same class.
@Override
A Java annotation used to indicate that a method is intended to override an inherited method. - redefining a parent class method in the child class
Byte
-128 to 128
Integer
32 bit; -2.1 billion to 2.1 billion
Long
64 bit whole number
Short
-32,768 to 32,768
isEmpty()
Checks whether its empty; returns true if value is null and false if full
static
MUST ALWAYS be included in main method
Array declarations
names the array and specifies the type of its elements. Ex) String[] name = new String[1];
Araylist
Objects are referenced by index inside parentheses (2)
.add()
Cannot be used by Arrays, must be converted to ArrayList to use
Float precision
Can only be precise to 6 or 7 digits; floats also tend to lose precision in calculations
Strings are:
immutable (cannot be changed)
parseDouble()
converts a string into a double
Nested branch
If statements inside of it statements
A .java file can only...
Have one public, non static class
Static belongs...
To a class, but doesn't belong to an instance of that class (it can be called without the instance of that class)
checked expression
Happen at compilation
Unchecked expressions
Happen at runtime
/**
Start of Javadoc
/*
Start of multi line comment