-
Notifications
You must be signed in to change notification settings - Fork 0
/
igcsekilograms.java
48 lines (34 loc) · 1.03 KB
/
igcsekilograms.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.util.ArrayList;
import java.util.Scanner;
public class igcsekilograms {
private static String Sname;
private String Sweight;
public igcsekilograms( String name, String weight) {
Sname = name;
Sweight = weight;
}
public String getName()
{
return Sname;
}
public String getAge()
{
return Sweight;
}
public String toString() {
return "name: " + Sname + " age: " + Sweight;
}
public static void main(String[] args)
{
ArrayList<igcsekilograms> students = new ArrayList<igcsekilograms>();
for(int i=0; i < 30; i++) {
Scanner input = new Scanner(System.in);
System.out.println("Name: ");
String name = input.nextLine();
System.out.println("Weight: ");
String weight = input.nextLine();
igcsekilograms student = new igcsekilograms(name, weight);
students.add(student);
}
}
}