Question: What is Variable in Java ?
Ans: Variable is is the name of memory location where we stored different type of value .
Example------
int a = 10;
Yaha 10 ek value hai jise ham store kr rhe a name ki memory location pe aur ise store krne ke liye memory space de rha int jo ki ek data type hai mtlb jis name se memory me data value save hogi use variable kehte hai
Types of variables ---------
1) Local variable
Jo variable kisi method ya function ke andar hota hai use local variable kehte hai jaise { } kisi if else ke andar hai to wo local variable hoti hai.
2) static Variable
Jisme static likha ho wo static variable hota hai
3 Instance Variable
4) final variable
Comments
Post a Comment