Author Archives: Stanislav_Panteleev

Java.Core.What are the advantages of using generics in Java?

Generics in Java are one of the most powerful language features, especially for writing type-safe, reusable, and flexible code. Here’s a clear breakdown of the key advantages of using generics:

Posted in Без рубрики | Comments Off on Java.Core.What are the advantages of using generics in Java?

Java.Core.ParallelStreams

🔗 What are Parallel Streams? Parallel Streams are a feature of the Java Stream API (introduced in Java 8) that allows you to process a collection of data in parallel — meaning the work is split into multiple threads that … Continue reading →

Posted in Без рубрики | Comments Off on Java.Core.ParallelStreams

Java.Core.What is the difference between shallow copy and deep copy in Java?

Let’s break down the difference between shallow copy and deep copy in Java — this is a classic interview topic, especially for cloning objects.

Posted in Без рубрики | Comments Off on Java.Core.What is the difference between shallow copy and deep copy in Java?

Java.Core.How does the Fork/Join framework work in Java?

🌐 What is the Fork/Join Framework? The Fork/Join Framework is a high-performance parallel computing framework designed to split large tasks into smaller subtasks, which can be processed in parallel on multiple CPU cores. After processing, results are combined (joined) to … Continue reading →

Posted in Без рубрики | Comments Off on Java.Core.How does the Fork/Join framework work in Java?

Java.Core.Why lambda work only with functional interfaces ?

🌐 First, What is a Functional Interface? A functional interface is an interface with exactly one abstract method.Examples:✅ Runnable (1 method: run())✅ Comparator (1 method: compare())✅ Callable (1 method: call())✅ Predicate (1 method: test())

Posted in Без рубрики | Comments Off on Java.Core.Why lambda work only with functional interfaces ?

Java.Core.What are lambda expressions, and why are they used?

🌐 What are Lambda Expressions? A lambda expression is a short, concise way to write anonymous functions (inline functions).It allows you to pass behavior (code) as a method argument — instead of writing long-winded anonymous classes.

Posted in Без рубрики | Comments Off on Java.Core.What are lambda expressions, and why are they used?

Java.Core.Provide example where we need class retention

For codegeneration tools, like Lombok 🌐 What is RetentionPolicy.CLASS? Definition @Retention(RetentionPolicy.CLASS) means the annotation is: ✅ Present in the compiled .class file❌ Not available at runtime (no reflection access)

Posted in Без рубрики | Comments Off on Java.Core.Provide example where we need class retention

Java.Core.If i don’t add @Override annotation will method be overrided ?

✅ Short Answer Yes, the method can still be overridden even if you don’t add @Override — but you lose the compiler’s help in checking correctness.

Posted in Без рубрики | Comments Off on Java.Core.If i don’t add @Override annotation will method be overrided ?

Java.Core.Provide example where we need source retention

Source retention needed for static analysis tool, for ex. Let’s walk through a practical example where @Retention(RetentionPolicy.SOURCE) is the best choice. This is typically used for compile-time annotations — annotations that are only useful to the compiler, linters, documentation tools, … Continue reading →

Posted in Без рубрики | Comments Off on Java.Core.Provide example where we need source retention

Java.Core.AnnotationRetention

@Retention is a meta-annotation, meaning it’s an annotation used to annotate other annotations.It tells the compiler and JVM how long your annotation should be retained (kept).

Posted in Без рубрики | Comments Off on Java.Core.AnnotationRetention