Author Archives: Stanislav_Panteleev

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 Без рубрики | Leave a comment

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 Без рубрики | Leave a comment

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 Без рубрики | Leave a comment

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 Без рубрики | Leave a comment

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 Без рубрики | Leave a comment

Java.Core.Can one catch block catch several exceptions at once?

✅ Yes! Since Java 7, a single catch block can handle multiple exceptions using the pipe (|) operator. This is called multi-catch exception handling.

Posted in Без рубрики | Leave a comment

Java.Core.Is it possible to use a try-finally block (without catch)?

✅ Yes, Java allows a try-finally block without a catch block. This is useful when you want to execute some code that might throw an exception but still need to perform cleanup actions, such as closing a file, releasing a … Continue reading

Posted in Без рубрики | Leave a comment

Java.Core.What is the try-with-resources mechanism?

he try-with-resources mechanism in Java is a feature introduced in Java 7 that automatically closes resources (such as files, sockets, and database connections) when they are no longer needed. It eliminates the need for explicitly closing resources in a finally … Continue reading

Posted in Без рубрики | Leave a comment

Java.Core.Describe the operation of the try-catch-finally block.

Operation of the try-catch-finally Block in Java The try-catch-finally block in Java is used for exception handling, ensuring that errors are caught, handled, and resources are cleaned up properly.

Posted in Без рубрики | Leave a comment

Java.What do you know about OutOfMemoryError?

What is OutOfMemoryError in Java? The OutOfMemoryError in Java is a serious runtime error that occurs when the Java Virtual Machine (JVM) runs out of memory and cannot allocate more objects. It belongs to the java.lang.Error class and is not … Continue reading

Posted in Без рубрики | Leave a comment