1/61
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Compile
translate source code written in Java into a form the computer can EXECUTE.
Interpret
execute a program by reading its instructions, one at a time, without first compiling the entire program into machine code.
Java Virtual Machine (JVM)
interprets at run time, allows bytecode in a .class file be executed by it. software appli cation that simulates a computer.
Constructors
used to create an instance of a class. initializes an object when created.
new
creates an object
super
refers to the parent/superclass
instantiation
creating an object from a class. (ex: Dog d = new Dog();)
method
block of code that performs an action.
declaration
tells Java something exists and gives it a type/name. (ex: int age;)
access modifiers
control who can access a class, variable, or method.
public
can be accessed from anywhere
private
can be accessed only in side the same class
protected
can be accessed only in same package + subclasses
package-private
can only be accessed in the same package
parameters
variable that receives information when a method is called
this
refers to the current object
default constructor
constructor with no parameters
public static void main(String[] args)
accessible to JVM, belongs to class not object, returns nothing, special starting method, array of command-line arguments
System.out.print()
outputs without adding a new line
System.out.println()
outputs while adding a new line
toString
returns a String representation of an object
equals
determines whether two objects are LOGICALLY equal.
==
for primitive types, compares values. for reference types, compares whether two references point to the same object.
!
means NOT
Object class
top-level superclass of Java classes, classes ultimately inherit from this class.
String
represents text
ArrayList<String>
resizable collection
interface List<String>
an interface
primitive type
stores simple values directly, usually lowercase.
reference type
refer to objects, usually uppercase.
Arrays
fixed number of values of the same type
wrapper class
represents primitive values as objects
instance methods/variables
belongs to a specific object
static methods/variables
belongs to the class itself
final
cannot be changed after initialization.
aliases
occurs when multiple reference variables refer to the same object.
casting
treating a value/reference as another type
overloading
same method name with different parameters
overriding
a subclass that provides its own version of an inherited method
@Override tag
not required, but helps catch mistakes and good for documentation
abstract classes/methods
a class that cannot be directly instantiated, and a method that has no implementation in the class. a subclass must implement it.
inheritance
allows one class to inherit from another.
Java “Lookup” rules
if the method exists in the reference’s declared type, the JVM looks for the overridden version (looks down). if the method does not exist, the JVM looks for the inherited version (looks up).
interfaces
defines methods that a class agrees to implement.
Comparable<>
used when a class has a natural ordering.
Comparator
allows you to define a separate way of comparing objects.
polymorphism
means one reference type can refer to different types of objects
remote git
copy of a project stored somewhere outside of your own machine. Great backup, and other people can contribute to your project.
git repository
tracks all changes made to your code
origin git
main remote reopsitory
local copy git
the Git repository stored on your computer that you can work on without connecting to the remote repository.
git add
moves changes to staging area
git commit
records staged changes in local Git history
git push
sends your local commits to the remote repository
git pull
gets changes from the remote repository and incorporates them into your local branch.
git status
shows current state of your working directory.
commit message
briefly describes what changed
fork
your own copy of someone else’s remote repository
branch
separate line of development in a Git repository, lets you work on changes without affecting another branch.
tracked
a file that Git is already aware of and is monitoring for changes.
untracked
a new file that Git knows exists but is not yet tracking.
modified files
a tracked file that has been changed since the last commit.