Author Archives: Stanislav_Panteleev

Java.Collections.What is SortedSet ?

SortedSet<E> is an interface in the Java Collections Framework that extends Set<E> and guarantees that its elements are sorted in ascending order (natural ordering or a custom comparator). It is useful when you need: A Set (i.e., no duplicate elements) … Continue reading →

Posted in Без рубрики | Comments Off on Java.Collections.What is SortedSet ?

Java.Collections.Arrange the following interfaces in a hierarchy: List, Set, Map, SortedSet, SortedMap,

Here’s the hierarchical structure of the given interfaces in the Java Collections Framework (JCF):

Posted in Без рубрики | Comments Off on Java.Collections.Arrange the following interfaces in a hierarchy: List, Set, Map, SortedSet, SortedMap,

Java.Collections.Name the main JCF interfaces and their implementations.

1. Collection Interface (Root Interface) The Collection<E> interface is the root of the framework, but it doesn’t have direct implementations. Instead, it has three key subinterfaces:

Posted in Без рубрики | Comments Off on Java.Collections.Name the main JCF interfaces and their implementations.

Java.Collections.What is a “collection”?

A collection in Java refers to objects that implement the Collection interface, which is part of the Java Collections Framework (JCF). 2. What Implements Collection? The Collection interface is implemented by these key interfaces: List<E> → ArrayList, LinkedList, etc. Set<E> … Continue reading →

Posted in Без рубрики | Comments Off on Java.Collections.What is a “collection”?

Java.Algo.1442. Count Triplets That Can Form Two Arrays of Equal XOR

You are given an array arr of integers. You need to count the number of triplets (i, j, k) such that: The XOR of the subarray from arr[i] to arr[j-1] is equal to the XOR of the subarray from arr[j] … Continue reading →

Posted in Без рубрики | Comments Off on Java.Algo.1442. Count Triplets That Can Form Two Arrays of Equal XOR

Java.Core.What is “internationalization”, “localization” in Java ?

Internationalization (i18n) & Localization (l10n) in Java Internationalization (i18n) and Localization (l10n) in Java are used to develop applications that support multiple languages, regions, and cultural formats without changing the core code.

Posted in Без рубрики | Comments Off on Java.Core.What is “internationalization”, “localization” in Java ?

Java.Core.What are generics?

✅ Generics in Java allow you to write type-safe, reusable, and flexible code by enabling parameterized types. They help avoid type casting and runtime ClassCastException errors.

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

Java.Core.Suppose there is a method that can throw IOException and FileNotFoundException, in what order should the catch blocks go? How many catch blocks will be executed?

Order of catch Blocks for IOException and FileNotFoundException In Java, exception handling follows the rule that subclass exceptions must be caught before their superclass exceptions. ✅ Key Rule: FileNotFoundException is a subclass of IOException, so it must be caught first. … Continue reading →

Posted in Без рубрики | Comments Off on Java.Core.Suppose there is a method that can throw IOException and FileNotFoundException, in what order should the catch blocks go? How many catch blocks will be executed?

Java.Core.Can the main method throw an exception outside and if so, where will this exception be handled?

Can the main() Method Throw an Exception in Java? ✅ Yes, the main() method can throw an exception outside using the throws keyword.🚨 However, if an exception is not handled inside main(), it will be handled by the JVM (Java … Continue reading →

Posted in Без рубрики | Comments Off on Java.Core.Can the main method throw an exception outside and if so, where will this exception be handled?

Java.Core.Is the finally block always executed?

✅ Yes, in most cases, the finally block always executes, regardless of whether an exception occurs or not.🚨 However, there are a few rare cases where it does NOT execute.

Posted in Без рубрики | Comments Off on Java.Core.Is the finally block always executed?