-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaug04.java
46 lines (39 loc) · 802 Bytes
/
aug04.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
package August;
import java.util.Arrays;
import java.util.List;
//import java.util.Arrays;
//import java.util.List;
public class aug04 {
public static void main(String[] args)
{
Crew[] cr =
{
new Crew(1, "Jonney Lam", 200.25),
new Crew(2, "Raghu Nath Patel", 25.5),
new Crew(3, "Krish Kumar", 45.25),
new Crew(12, "Ahmaed Abdul", 5000.15)
};
List<Crew> clist= Arrays.asList(cr);
clist.stream().forEach(cre -> cre.dispalyRaise(2));
for(int i =0 ; i < cr.length; i++)
{
System.out.println(cr[i].C_Name);
}
}
}
class Crew{
int C_id;
String C_Name;
double C_Salary;
//constructor
public Crew(int id, String nm, double sl)
{
this.C_id = id;
this.C_Name = nm;
this.C_Salary = sl;
}
public void dispalyRaise(int i)
{
this.C_Salary *= i;
}
}