Author Archives: Stanislav_Panteleev

Java.Core.Explain the use of annotations in Java. Provide examples.

Annotations are special markers (@AnnotationName) added to classes, methods, variables, or parameters to provide metadata. They don’t affect program logic directly. They can be processed at compile-time (for warnings, code generation) or at runtime (for reflection-based frameworks like Spring, JPA).

Posted in Без рубрики | Comments Off on Java.Core.Explain the use of annotations in Java. Provide examples.

Java.Core.What is the difference between public, protected, default, and private access modifiers?

🌐 What are Access Modifiers? Access modifiers control where a class, method, or field can be accessed from.Java provides 4 levels of access: Modifier Access Scope public Accessible from everywhere (inside the class, package, subclasses, and outside packages) protected Accessible … Continue reading →

Posted in Без рубрики | Comments Off on Java.Core.What is the difference between public, protected, default, and private access modifiers?

Java.Core.What is the role of class loaders in Java

🌐 What is a Class Loader? A class loader in Java is part of the JVM responsible for loading class files into memory when a program is running.Java programs are compiled into .class files, and class loaders handle converting those … Continue reading →

Posted in Без рубрики | Comments Off on Java.Core.What is the role of class loaders in Java

Java.Core.How to write a good hash function ?

Writing a good hash function is a crucial skill, especially if you’re designing custom hash-based data structures like hash tables. Here’s a breakdown of what makes a good hash function and how to write one:

Posted in Без рубрики | Comments Off on Java.Core.How to write a good hash function ?

Java.Core.How does the hashCode() method relate to equals() in Java?

It’s used by hash-based collections (like HashMap, HashSet) to quickly find the object. Think of it as a “bucket number” where the object might live.

Posted in Без рубрики | Comments Off on Java.Core.How does the hashCode() method relate to equals() in Java?

Java.Core.Why we can assign greeting::length to Supplier

✅ We can assign greeting::length to Supplier<Integer> because their method signatures match. 🔗 Let’s Compare the Signatures Supplier Functional Interface Method signature: Integer get()

Posted in Без рубрики | Comments Off on Java.Core.Why we can assign greeting::length to Supplier

Java.Core.What is bound and unbound method references ?

Great question! The terms bound method reference and unbound method reference are not official Java terms, but they are very useful to understand how method references work internally — and they come up a lot in advanced interviews.

Posted in Без рубрики | Comments Off on Java.Core.What is bound and unbound method references ?

Java.Core.Explain dynamic method dispatch in Java

🌐 What is Dynamic Method Dispatch? Dynamic Method Dispatch (also known as Runtime Polymorphism) is the mechanism where: 👉 The method to be called is determined at runtime, based on the actual object type — not the reference type.

Posted in Без рубрики | Comments Off on Java.Core.Explain dynamic method dispatch in Java

Java.Core.What is the purpose of the Optional class in Java?

🌐 What is Optional? Optional<T> is a container object that may or may not contain a non-null value.It’s designed to help avoid null checks and reduce the chances of getting dreaded NullPointerException (NPE).

Posted in Без рубрики | Comments Off on Java.Core.What is the purpose of the Optional class in Java?

Java.Core.What are method references in Java? How are they used?

🌐 What are Method References? A method reference is a shortcut (syntactic sugar) that lets you refer to a method directly — instead of writing a full lambda expression. You can use method references wherever a functional interface is expected.

Posted in Без рубрики | Comments Off on Java.Core.What are method references in Java? How are they used?