-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bag.java
46 lines (35 loc) · 857 Bytes
/
Bag.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
class Bag implements BagInterface
{
int chain, pocket;
String brand_name;
public void numberOfChains(int value)
{
chain = value;
}
public void numberOfPockets(int value)
{
pocket = value;
}
public void bagBrand(String name)
{
brand_name = name;
}
public void BagDetails()
{
System.out.print("Brand Name: "+brand_name+" Number of chains: "+chain+" Number of Packets: "+ pocket);
System.out.println();
}
public static void main(String [] args)
{
Bag bag1 = new Bag();
Bag bag2 = new Bag();
bag1.brand_name = "Case Werkz";
bag1.chain = 4;
bag1.pocket = 8;
bag1.BagDetails();
bag2.brand_name = "Puma";
bag2.chain = 4;
bag2.pocket = 5;
bag2.BagDetails();
}
}