Concepts Flashcards
Bytecode
An intermediate code between the source code and machine code.
JVM
Java Virtual Machine. It interprets the bytecode into machine code. It is part of the JRE.
JDK
Java Development Kit. It includes JRE, a Java compiler, a debugger, and more;
JRE
Java Runtime Environment; Executes Java programs; It includes JVM and Java libraries.
Declaring a variable
what kind of data it will store
What is a Java class?
a template (blueprint) that is used to create objects. It consists of data members and methods.
Object
objects have states and behaviors.
Eclipse
a Java IDE (Integrated Development Environment). It includes text editor, compiler or interpreter, and debugger, like IntelliJ IDEA
IDE
Integrated Development Environment. for example, visual studio.
How to create a Java object?
Declaration; Instantiation; Initialization
ClassName object = new ClassName()
What are Java constructors?
- A special method that is used to initialize objects
- You would call a constructor when an object is created. It can be used to set initial values for object attributes.
- Note that the constructor name must match the class name and it can’t have a return type (like void)
Pascal case
a naming convention in which the first letter of each word in a compound word is capitalized.
SDK
software development kit
Java variable
a location in memory (storage area) to hold data. Each variable should be given a unique name (identifier)
statically-typed language
It means that all variables must be declared before they can be used.
Java expressions
a construct made up of variables, operators, literals, and method calls.
Java operators
- arithmetic
- assignment
- comparison
- logical
truth table
a mathematical table used to determine if a compound statement is true or false.
component statement
public in Java
an access modifier
- the class is accessible by any other class
- the code is accessible for all classes
default in Java
an access modifier
- the class is only accessible by classes in the same package.
- the code is only accessible in the same package.
private in Java
an access modifier
- the code is only accessible within the declared class.
final in Java
if you don’t want the ability to override existing attributes values, declare attributes as final
static methods/attributes in Java
can be accessed without creating an object of the class first
Java statement
a complete unit of execution