Variables Of Java Class part-2

By // 2 comments:
Thumbnail
In the previous post, talked about how many elements of a java class & local variable. Now we learn about Instance variable. 2. Instance Variable Declaration:- The variables which are declared inside the class but outside of the method that are called instance variable. Scope:- The variable can access inside the class. All methods, constructors and blocks of the class also able to access the variables. Memory Allocation:- Memory is allocated in object...

Variables Of Java Class part-1

By // 5 comments:
Thumbnail
In the first tutorial, I discussed that, a java class have five elements. Variable is one of these. Now we discuss about variable. There are three types of variables. They are.. Local Variable Declaration:- Declared inside the method or constructor or blocks. Scope:- We can access the local variable only within the method, within the constructor or within the block. Out side is not possible. Memory allocation:- When method or constructor of blocks start memory are allocated. When...