Java Flashcards
OO - What is a Class ?
A class is an abstract blueprint that creates more specific, concrete objects.
OO - What is an Object
An object is an instance of a class.
OO - Encapsulation
Encapsulation refers to the bundling of data with the methods that operate on that data within a single unit, i.e., class.
OO - Inheritance
Inheritance allows us to define a class in terms of another class, which makes it easier to create and maintain an application. This also provides an opportunity to reuse the code functionality and fast implementation time.
OO - Abstraction
Abstraction refers to the act of representing essential features without including background details - implementation
OO - Polymorphism - Compile Time
Compile-time polymorphism is also known as static polymorphism. This type of polymorphism is achieved by function overloading or operator overloading
OO - Polymorphism - RunTime
Runtime polymorphism, on the other hand, is also known as dynamic polymorphism. This type of polymorphism is achieved by method overriding
Collections - Interfaces
The Java Collections Framework provides a set of interfaces that define the behavior of different types of collections. These interfaces include List, Set, Queue, and Map.
Collections - Classes
The Java Collections Framework also provides a set of classes that implement these interfaces. These classes include ArrayList, LinkedList, HashSet, and TreeMap.
Collections - Generics
The Java Collections Framework uses generics to ensure type safety when working with collections.
Collections - Iterators
The Java Collections Framework provides an iterator interface that allows you to traverse the elements of a collection
Collections - Algorithms
The Java Collections Framework provides a set of algorithms that can be used to perform common operations on collections, such as sorting, searching, and shuffling.
Collections - Concurrency
The Java Collections Framework provides thread-safe implementations of some collection classes, such as ConcurrentHashMap and CopyOnWriteArrayList, which can be used in concurrent environments.
Generics - Type Safety
Generics provide compile-time type safety, which means that you can catch errors at compile time rather than at runtime.
Generics - Type Erasure
Java uses type erasure to implement generics. This means that the type information is removed at runtime, which allows you to use generics with legacy code that was written before generics were introduced.
Generics - Wild Cards
Wildcards allow you to specify a range of types that a generic class can work with. This is useful when you want to write code that can work with a variety of different types.
Generics - Bounded Type Parameters
Bounded type parameters allow you to specify a range of types that a generic class can work with. This is useful when you want to write code that can work with a variety of different types, but still maintain some level of type safety.
Generics - Generic Methods
Generic methods allow you to write methods that can work with different types of objects. This is useful when you want to write code that can work with a variety of different types, but don’t want to create a new class for each type.
Func.Prog - Lambda expressions
Lambda expressions are a new feature introduced in Java 8 that allow you to write functional-style code in Java. They are used to represent anonymous functions that can be passed around as values.
Func.Prog - Streams
Streams are a new feature introduced in Java 8 that allow you to process collections of data in a functional style. They provide a way to perform operations such as filtering, mapping, and reducing on collections of data.
Func.Prog - Immutability
Immutability is an important concept in functional programming. It means that once an object is created, it cannot be changed. In Java, you can create immutable objects using the final keyword or by using the java.util.Collections class.