-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariables.java
More file actions
35 lines (31 loc) · 780 Bytes
/
Variables.java
File metadata and controls
35 lines (31 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class Variables{
String name; //Class Scope
int price; //Default=0
boolean isReady; //Default=false
static String surname="Mondal"; //Class scope
public static void main(String[] args){
//dataType variableName = value;
int age=25;
}
public void displayAge(){
int age=20; //Local Scope
System.out.println(age);
byte b=10;
short s=100;
long population =80000000;
float pi=3.14f;
double gpa=9.5;
char grade='A' ;
boolean isJavaFun =true;
int price=100;
int $price=100;
int _price=100;
int Price$Of_Car=100000;
String firstName="Saptarshi";
int x=13;
int numberOfStudent=13;
if(true){
int number=10; //Block Scope
}
}
}