Let’s learn more about local variables in Java. Variables that are declared inside Methods in a Java program are called local variables. [Read more…]
Search Results for:
Here we will learn about instance variables in Java with the help of an example. Instance variables are used by Objects to store their states. Variables which are defined without the STATIC keyword and are Outside any method declaration are Object specific and are known as instance variables. They are called so because their values are instance specific and are not shared among instances. [Read more…]
Reference variables are used to refer to an object. They are declared with a specific type which cannot be changed.
Types of reference variables
- Static Variable
- Instance Variable
- Method Parameter
- Local Variable
Thread term can be used in two ways
- An instance of class java.lang.Thread
- A Thread of Execution
String is one of mostly used Object in Java. And this is the reason why String has unique handling in Java(String Pool).
- The String class represents character strings.
- All string literals in Java programs, such as “abc”, are implemented as instances of this class.
- Strings are like constants, once created its value can not be changed.
- String objects are immutable and hence it can be shared.
- String Buffer and String Builder can be used in place of String if lot of String Operation is to be performed. [Read more…]