Week 2 - Core Java, OOP, Exceptions, Testing & Agile

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/66

encourage image

There's no tags or description

Looks like no tags are added yet.

67 Terms

1
New cards
[Java Overview] What is Java?
A statically typed, object-oriented programming language compiled to bytecode that runs on a JVM.
2
New cards
[Java Overview] What are JDK, JRE and JVM?
JVM executes bytecode; JRE supplies the runtime; JDK includes tools such as javac for developing Java programs.
3
New cards
[Java Overview] What is the JIT compiler?
The Just-In-Time compiler translates frequently executed bytecode into native machine code at runtime.
4
New cards
[Java Overview] What is Java bytecode?
Platform-independent intermediate instructions produced by Java compilation and executed by a JVM.
5
New cards
[Java Overview] Why is Java called platform independent?
Compiled bytecode can run on compatible JVMs across operating systems.
6
New cards
[Java Overview] What does public static void main(String[] args) mean?
public makes it accessible, static allows class-level invocation, void returns nothing, main is the entry method, and args receives command-line arguments.
7
New cards
[Java Basics] What are primitive Java types?
byte, short, int, long, float, double, char and boolean.
8
New cards
[Java Basics] What is a wrapper class?
An object type representing a primitive, such as Integer for int and Boolean for boolean.
9
New cards
[Java Basics] What is autoboxing and unboxing?
Automatic conversion between primitives and corresponding wrapper objects.
10
New cards
[Java Basics] What is the difference between == and equals()?
== compares primitive values or object references; equals() can compare logical object content.
11
New cards
[Java Basics] Why is String immutable?
A String object's contents cannot change after creation; operations create new String values.
12
New cards
[Java Basics] What does static mean in Java?
A member belongs to the class rather than an individual instance.
13
New cards
[Java Basics] What does final mean?
A final variable cannot be reassigned, a final method cannot be overridden, and a final class cannot be extended.
14
New cards
[Java Basics] What is the difference between final, finally and finalize?
final is a modifier; finally is a cleanup block; finalize was an unreliable deprecated finalization mechanism.
15
New cards
[Java Basics] What is the difference between stack and heap?
Stack frames hold method-local execution state; the heap holds objects managed by garbage collection.
16
New cards
[Classes and Objects] What is a class?
A blueprint defining an object's fields, constructors and methods.
17
New cards
[Classes and Objects] What is an object?
A runtime instance of a class with identity, state and behavior.
18
New cards
[Classes and Objects] What is a constructor?
A special initializer invoked when creating an object, usually to establish valid initial state.
19
New cards
[Classes and Objects] What is constructor overloading?
Defining multiple constructors with different parameter lists.
20
New cards
[Classes and Objects] What is this in Java?
A reference to the current object, often used to distinguish instance fields from parameters.
21
New cards
[Classes and Objects] What is a singleton?
A design pattern ensuring only one instance of a class is available through controlled access.
22
New cards
[Classes and Objects] What are Java access modifiers?
public, protected, package-private and private control member visibility.
23
New cards
[Methods] What is method overloading?
Multiple methods share a name but differ in parameter types or counts; resolved at compile time.
24
New cards
[Methods] What is method overriding?
A subclass supplies a compatible implementation of an inherited instance method; selected dynamically.
25
New cards
[Methods] What is the difference between parameters and arguments?
Parameters are method declaration variables; arguments are values supplied at a call site.
26
New cards
[Methods] What is pass-by-value in Java?
Java passes copies of values, including copies of object references, to methods.
27
New cards
[Methods] What is a static method?
A method associated with the class and callable without an instance.
28
New cards
[Methods] Can static methods be overridden?
No; subclass static methods hide superclass methods rather than overriding them.
29
New cards
[Object-Oriented Programming] What are the four pillars of OOP?
Encapsulation, inheritance, polymorphism and abstraction.
30
New cards
[Object-Oriented Programming] What is encapsulation?
Bundling state and behavior and controlling access to internal implementation details.
31
New cards
[Object-Oriented Programming] What is inheritance?
A subclass extends a superclass to reuse and specialize accessible behavior.
32
New cards
[Object-Oriented Programming] What is polymorphism?
The same interface or method call can behave differently depending on the actual object type.
33
New cards
[Object-Oriented Programming] What is abstraction?
Exposing essential behavior while hiding implementation details.
34
New cards
[Object-Oriented Programming] What is an abstract class versus an interface?
An abstract class can hold shared state and implementation; an interface defines a contract and may include default or static methods.
35
New cards
[Object-Oriented Programming] Can Java classes extend multiple classes?
No; Java has single class inheritance, but a class can implement multiple interfaces.
36
New cards
[Object-Oriented Programming] What is the difference between composition and inheritance?
Composition builds behavior using contained objects; inheritance establishes an is-a relationship.
37
New cards
[Exceptions] What is an exception?
An object representing an abnormal condition that interrupts normal program execution.
38
New cards
[Exceptions] What are checked and unchecked exceptions?
Checked exceptions must be caught or declared; unchecked exceptions extend RuntimeException and need not be declared.
39
New cards
[Exceptions] How do try, catch and finally work?
try encloses risky code, catch handles matching exceptions, and finally generally runs cleanup logic.
40
New cards
[Exceptions] What is the difference between throw and throws?
throw raises an exception; throws declares possible exceptions in a method signature.
41
New cards
[Exceptions] How do you create a custom exception?
Define a class extending Exception for checked or RuntimeException for unchecked behavior.
42
New cards
[Exceptions] What is try-with-resources?
A try statement that automatically closes AutoCloseable resources when the block finishes.
43
New cards
[Exceptions] How do Error and Exception differ?
Errors generally signal serious JVM or system problems; exceptions represent conditions applications may handle.
44
New cards
[Java IO] What is Java I/O?
APIs for reading and writing bytes, characters and files.
45
New cards
[Java IO] What is an InputStream versus Reader?
InputStream handles bytes; Reader handles decoded characters.
46
New cards
[Java IO] What is an OutputStream versus Writer?
OutputStream writes bytes; Writer writes characters.
47
New cards
[Java IO] What is buffering?
Temporarily storing data to reduce costly underlying read and write operations.
48
New cards
[Java IO] What is the NIO Files API?
java.nio.file provides Path and Files utilities for file and directory operations.
49
New cards
[Java IO] How should files be closed safely?
Use try-with-resources so streams and readers close even if an exception occurs.
50
New cards
[Logging] What is logging?
Recording diagnostic and operational events to understand application behavior and failures.
51
New cards
[Logging] What are common logging levels?
TRACE, DEBUG, INFO, WARN and ERROR, from fine detail to serious failures.
52
New cards
[Logging] Why use SLF4J instead of System.out.println?
SLF4J offers consistent logging APIs, configurable levels and integration with logging backends.
53
New cards
[Logging] What should not be logged?
Passwords, access tokens, private keys and unnecessary sensitive user information.
54
New cards
[Logging] What is structured logging?
Emitting consistent key-value fields to make logs searchable and analyzable.
55
New cards
[Testing] What is unit testing?
Testing a small unit of behavior in isolation, typically using JUnit in Java.
56
New cards
[Testing] What is an integration test?
Testing interactions between components or with infrastructure such as a database.
57
New cards
[Testing] What is JUnit?
A Java testing framework with annotations and assertions for automated tests.
58
New cards
[Testing] What is Mockito?
A mocking framework used to replace collaborators and verify interactions in tests.
59
New cards
[Testing] What is the testing pyramid?
Many fast unit tests, fewer integration tests and a smaller number of end-to-end tests.
60
New cards
[Testing] What is the difference between assertion and mock?
An assertion checks an observed result; a mock simulates or verifies a dependency's behavior.
61
New cards
[Agile and Scrum] What is Agile software development?
An iterative approach emphasizing collaboration, feedback, adaptation and frequent delivery of value.
62
New cards
[Agile and Scrum] What is Scrum?
An Agile framework using time-boxed Sprints and defined accountabilities, events and artifacts.
63
New cards
[Agile and Scrum] What is a Sprint?
A fixed-length iteration of one month or less producing a usable Increment.
64
New cards
[Agile and Scrum] What are Scrum roles?
Product Owner, Scrum Master and Developers form the Scrum Team.
65
New cards
[Agile and Scrum] What is a daily Scrum?
A short daily event where Developers inspect progress toward the Sprint Goal and adapt their plan.
66
New cards
[Agile and Scrum] What is the difference between Agile and Waterfall?
Agile delivers iteratively and adapts to change; Waterfall generally follows sequential phases with more upfront planning.
67
New cards
[Agile and Scrum] What is a retrospective?
A Scrum event to inspect how the Sprint went and identify improvements.