Default value of variable in java Variables declared inside a class are known as member variables (static or non static). These variables are initialized with their default value depending on the type of variable. For example variable of type int
Why is the java main method static?
main method in java is static This is neccesary because main() is called by the JVM before any objects are made. Since it is static it can be directly invoked via the class.
What is the difference between ArrayList and Vector in Java?
ArrayList vs Vector ArrayList Vector Not Synchronized and so not thread safe Synchronized therfore thread safe Fast in performance Slow as it is thread safe Introduced first in java version 1.2 Introduced first in java version 1.0 does not provide
What is the difference among String, StringBuffer and StringBuilder in Java?
What is the difference among String, StringBuffer and StringBuilder in Java? String String is immutable ( once created can not be changed )object . The object created as a String is stored in the Constant String Pool . Every immutable
What is immutable object in Java?
What is immutable object in Java? Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example is String is immutable in Java. Mostly Immutable are also