Java Flashcards
What is Java?
- A commonly used OOP language
- It is a complied language
Why use Java?
- Widely used
- Lots of documentation
- Great exception handling
- Lots of environments support Java
- Forwards compatible
Is Java 100% OOP?
No, primitives are not objects.
What is the JDK?
The Java Development Kit contains compiler and debugger tools to compile the Java Source Code. Also contains the JRE and JVM
What is the JRE?
The Java Runtime Environment provides an environment and in that environment the JVM runs the compiled byte code. Also contains the JVM and library
What is the JVM?
The Java Virtual Machine creates a layer of abstraction from the Java Code and the computer environment. It is used to convert java bytecode to machine readable code.
What is a State?
Properties of an object
What is a behaviour?
Actions that an object can take
What is an Object?
An object is an instantiation of a class
What is a class?
A class is the blueprints that provides the States and Behaviors its instantiated object will have.
What are the class members?
- Instance variables
- Methods
- Constructors
- Inner class
- static/instance blocks
What are the types of variables?
- Instance
- Local
- Static
What are the scopes of variables?
- Class–inside class
- Method–inside method
- Block–inside for or if statements
What are the Access Modifiers?
- public–globally accessible
- private–accessible only within that class
- protected–accessible only within that package and its sublclasses
- default–accessible only within that package
What are the Non-Access Modifiers?
- static
- final
- abstract
- synchronized
- volatile
- transient
What is the Static Modifier?
variable or function belongs to all instances of that class as it belongs to the type, not the actual objects themselves
What is the Final Modifer?
Define an entity that can only be assigned once. Once a final variable has been assigned, it cannot be changed.
What is the Abstract Modifier?
used for the purpose of extending.
What is the synchronized modifier?
used for threads. accessed by only one thread at a time