-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntro.java
More file actions
40 lines (34 loc) · 1.56 KB
/
Copy pathIntro.java
File metadata and controls
40 lines (34 loc) · 1.56 KB
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
package ObjectsSystem;
import java.util.*;
public class Intro{
private static String Name = "Gael";
private static int Age = 19;
private static String Specialization = "Enterprise Systems";
private static String CareerPath = "Software Development";
private static HashMap <Object,Object> Weapons = new HashMap<>();
private static void Introduction(){
System.out.println(String.format("%s is age %d. He specializes in %s for the career of %s",Name,Age,Specialization,CareerPath));
}
static void WeaponOfChoice(String name, String Affinity, String Purpose, String Type){
Weapons.put("Weapon Name",name);
Weapons.put("Weapon Affinity",Affinity);
Weapons.put("Purpose",Purpose);
Weapons.put("Weapon Type",Type);
System.out.println(String.format("Weapon '%s' has been initialized.",Weapons.get("Weapon Name")));
}
static void ShowWeapon(){
System.out.println(String.format("%s has a weapon named '%s' with an affinity of %s with the purpose: '%s'. It is a %s type.",Name,Weapons.get("Weapon Name"),Weapons.get("Weapon Affinity"),Weapons.get("Purpose"),Weapons.get("Weapon Type")));
}
static void ChangeWeapon(String Choice, String NewValue){
Weapons.put(Choice,NewValue);
}
public static void main(String args[]){
Introduction();
WeaponOfChoice("Mystrus", "Abyssal", "Destroy/Defense", "Range");
ShowWeapon();
ChangeWeapon("Weapon Name", "Decoretum");
ShowWeapon();
ChangeWeapon("Weapon Type", "Melee");
ShowWeapon();
}
}