Author Archives: Stanislav_Panteleev

Java.Core.What bitwise operations do you know?

Bitwise Operators in Java Bitwise operators in Java operate on individual bits of integer values. These operators are useful for low-level programming, optimizations, and working with binary numbers.

Posted in Без рубрики | Comments Off on Java.Core.What bitwise operations do you know?

Java.Core.What logical operations and operators do you know?

1. Logical AND (&&) The AND (&&) operator returns true only if both operands are true. Otherwise, it returns false.

Posted in Без рубрики | Comments Off on Java.Core.What logical operations and operators do you know?

Java.Core.What do you know about the main() function?

main() Method in Java The main() method is the entry point for Java applications. It is where execution begins when you run a Java program.

Posted in Без рубрики | Comments Off on Java.Core.What do you know about the main() function?

Java.Core.Provide example where we in some object but syncing another one

Example: Synchronizing on a Different Object Sometimes, instead of synchronizing on this, we lock a different object to control access to a shared resource.

Posted in Без рубрики | Comments Off on Java.Core.Provide example where we in some object but syncing another one

Java.Core.Why do we need write smth in parenthesies in synchronized ? why we can’t just type synchronized ?

Why Do We Need Parentheses in synchronized()? In Java, the synchronized keyword requires an object reference inside parentheses (synchronized(obj)) because it tells Java which object’s monitor (lock) to use for synchronization.

Posted in Без рубрики | Comments Off on Java.Core.Why do we need write smth in parenthesies in synchronized ? why we can’t just type synchronized ?

Java.Core.Why do we need instance blocks if we have constructor ?

Why Do We Need Instance Initialization Blocks (IIB) If We Have Constructors? Instance Initialization Blocks (IIB) are not strictly necessary, but they provide some benefits over constructors in certain cases. Here’s why:

Posted in Без рубрики | Comments Off on Java.Core.Why do we need instance blocks if we have constructor ?

Java.Core.Tell me about blocks in Java what are they ?

Blocks in Java A block in Java is a group of statements enclosed within curly braces {}. Blocks define the scope of variables and control execution flow.

Posted in Без рубрики | Comments Off on Java.Core.Tell me about blocks in Java what are they ?

Java.Core.What values are variables initialized to by default ?

🔹 Default Values of Variables in Java In Java, the default value of a variable depends on its data type and where it’s declared (instance variable, static variable, or local variable).

Posted in Без рубрики | Comments Off on Java.Core.What values are variables initialized to by default ?

Java.Core.How does ThreadLocal work in Java?

ThreadLocal in Java ThreadLocal in Java provides thread-local variables, meaning each thread accessing a ThreadLocal variable will have its own isolated copy of that variable. This is useful when you want to store per-thread data without worrying about synchronization.

Posted in Без рубрики | Comments Off on Java.Core.How does ThreadLocal work in Java?

Java.Core.Why do i know class information in compile time ?

You know class information at compile time because Java’s compiler enforces strict static typing. This means that class definitions and type information are determined before your program runs. Here’s why and when you know class information at compile time:

Posted in Без рубрики | Comments Off on Java.Core.Why do i know class information in compile time ?