-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday-3 code ex
More file actions
44 lines (31 loc) · 785 Bytes
/
day-3 code ex
File metadata and controls
44 lines (31 loc) · 785 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
36
37
38
39
40
41
42
43
44
#### how variable works
class College {
static String collegeName = "IIT Delhi";
int studentId;
void display() {
System.out.println(studentId + " " + collegeName);
}
}
class Demo {
public static void main(String[] args) {
College c1 = new College();
c1.studentId = 101;
College c2 = new College();
c2.studentId = 102;
c1.display();
c2.display();
}
}
### how datatypes work!!1
class Demo {
public static void main(String[] args) {
int age = 21;
double marks = 85.5;
char grade = 'A';
boolean passed = true;
System.out.println(age);
System.out.println(marks);
System.out.println(grade);
System.out.println(passed);
}
}