Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,14 @@
public static void main(String... args){
HashMap<String, Integer> vars = new HashMap<String, Integer>();
//The variable name is stored as the String. The var type of the variable can be
//changed by changing the second data type mentiones. However, it must be an object
//or a wrapper class.
vars.put("Variable name", 3); //declaration of variables
vars.put("Next variable name", 5);
Scanner sc = new Scanner(System.in);
String str = sc.next();
vars.put(str, sc.nextInt()); //accpeting name and value from user
System.out.println(vars.get("Variable name")); //printing of values
System.out.println(vars.get(str));
}