What Are The Rules For Primitive Arithmetic Promotion Conversion

: For Unary operators If operant is byte, short or a char it is converted to an int. If it is any other type it is not converted. In Java, primitive arithmetic promotion conversion follows a set of rules to determine the type of the result when performing operations on primitive data types. The rules … Read more

What Are Volatile Variables

It indicates that these variables can be modified asynchronously. In Java, the volatile keyword is used to indicate that a variable’s value may be changed by multiple threads simultaneously. It ensures that any thread that reads the variable sees the most recent modification made by any other thread. When a variable is declared as volatile, … Read more

What is Synchronized Modifier Used For

It is used to control access of critical code in multithreaded programs. In Java, the synchronized modifier is used to control access to a block of code or a method by multiple threads. When a method or a block of code is declared as synchronized, only one thread can access it at a time. This … Read more

What Are Transient Variables

A transient variable is not stored as part of objects persistent state and they cannot be final or static. In Java, the transient keyword is used in the context of instance variables to indicate that the variable should not be serialized during the process of object serialization. Serialization is the process of converting an object … Read more

Where is Native Modifier Used

It can refer only to methods and it indicates that the body of the method is to be found else where and it is usually written in non java language. In Core Java, the native modifier is used in method declarations to indicate that the method is implemented in a language other than Java, typically … Read more