-
Notifications
You must be signed in to change notification settings - Fork 0
/
Variables.java
25 lines (19 loc) · 1017 Bytes
/
Variables.java
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
// real world problems - like net banking, replacing real world with virtual world we need data
// and also we need processing on data
// data may be from user and you will do something to that data
// we may also store data after processing - we need database(a permanent storage- replace a value but it is stored there)
// receive data - process -> temporary purpose(variables)
// imagine variable as an image, text, integer, video that is data right
// maybe we can give it a name, one more box
// variable can have a name to access the value inside it
// strongly typed language (java) - tell me what kind of data type you want , for example i want integer its int a = 9; i have created integer a, and value inside it is 9
class variables{
public static void main(String args[]){
int n1 = 9;
System.out.println(n1);
int num_1 = 9;
int num_2 = 20;
System.out.println(num_1+num_2);// addition
System.out.println(num_1*num_2);
}
}