#14 What is Variable in Java ? Types of Variable ? Use of Local , Static ,Instance & Final Variable
package com.sudhirtheindian2.java123;
import java.util.Scanner;
public class variable {
int a =10;
public static void main(String[] args) {
// What is variable and types of variable in java
// 1 variable is the name of memory location where
// we stored different types of value
// 2 without variable name we can not store value
// types of variable
//
// 1 local
// 2 static
// 3 instance
// 4 final
//local variable
// 1 under the block { }
// 2 without making object we can access local variable
// static variable
// 1 with static keyword
// 2 without making object we can access static variable
// instance
// 1 under the class
// 2 outside of method or block
// 3 without making object we can not access instance variable
// final
// we can not change final variable value
}
}
टिप्पणियाँ
एक टिप्पणी भेजें