-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent2.java
More file actions
41 lines (34 loc) · 784 Bytes
/
Student2.java
File metadata and controls
41 lines (34 loc) · 784 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
import java.lang.String;
import java.util.ArrayList;
class Student2 {
String name;
int age, roll, marks;
Student2(String name, int age, int roll, int marks) {
this.name = name;
this.age = age;
this.roll = roll;
this.marks = marks;
}
public String toString() {
return name + "--" + age + "--" + roll + "--" + marks;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public int getRoll() {
return roll;
}
public int getMark() {
return marks;
}
}
class Call {
void work() {
ArrayList<Student2> db = new ArrayList<Student2>(10);
Student2 s = new Student2("Riya", 56, 23, 76);
db.add(s);
}
}