Variables in java || || Types of variables in java || Local,statica nd instance || java language ||
Hey learners, I'm Karmjyot Kaur. Let's learn variables in java.
what are variables?
ans:- A variable is a name given to memory location. It is the basic unit of storage in a program. eg int age=20;
In this int is a datatype and age is the name of the variable and 20 is the value.
2 How many types of variables are there in java?
ans:- There are 3 types of variables in java.
1. local variable:- a variable defined within a block or constructor is called a local variable.
2. Instance variable:- Instance variables are non-static variables and are declared in a class outside any method, constructor or block.
3. static variable:- these variables are declared similarly as instances but the only difference is that these are declared using a static keyword within a class outside any method constructor or block.
This java tutorial will teach you about the variables in java. This complete java course will help you master all the concepts you need to learn in java.
Related Queries !
java variables
how many types of variables in java
local static and instance variable in java
let's connect on social media:-
1. Facebook:-
2. Instagram:-
3. Twitter:-
DM me if you have any Queries !
#javavariables #javalanguage #java