What are Transient and Volatile Modifiers?

Transient: The transient modifier applies to variables only and it is not stored as part of its object’s Persistent state. Transient variables are not serialized. Volatile: Volatile modifier applies to variables only and it tells the compiler that the variable modified by volatile can be changed unexpectedly by other parts of the program. In Java, … Read more

What is finalize() method?-

finalize () method is used just before an object is destroyed and can be called just prior to garbage collection. In Core Java, the finalize() method is a method provided by the Object class. It is called by the garbage collector when it determines that there are no more references to the object. The purpose … Read more

What is Garbage Collection and how to call it explicitly?

When an object is no longer referred to by any variable, java automatically reclaims memory used by that object. This is known as garbage collection. System. gc() method may be used to call it explicitly. In Java, garbage collection is a process by which the Java Virtual Machine (JVM) automatically manages memory by reclaiming the … Read more

What is UNICODE?-

Unicode is used for internal representation of characters and strings and it uses 16 bits to represent each other. Unicode is a standardized encoding system that assigns unique characters (including letters, numbers, symbols, and control characters) to every character in most of the world’s writing systems. It is designed to be a universal character set, … Read more

What is final, finalize() and finally?-

final : final keyword can be used for class, method and variables. A final class cannot be subclassed and it prevents other programmers from subclassing a secure class to invoke insecure methods. A final method can’t be overridden. A final variable can’t change from its initialized value. finalize() : finalize() method is used just before … Read more