how can I get a specific data on a map in java? [closed]

0

Hello, how can I take a specific value within a map? by means of a set ??

            do {
                Student s = new Student();

                s.setListName(numerolista2);
                System.out.println("ingrese su nombre:");
                String name = sc.nextLine();
                s.setName(name);
                System.out.println("calificacion");

                int grade = sc.nextInt();
                s.setGrade(grade);
                sc.nextLine();
                map.put(numerolista2, s);

                System.out.println("deseas calificar mas alumnos: ");
                repetir = sc.nextInt();
                sc.nextLine();

            } while (repetir == 1);

            break;

        }
    
asked by Alejandra Luna 08.11.2016 в 06:57
source

1 answer

2

To obtain the value of a java map you must use the get (key) method, you must pass it as a parameter the key that you used to store the value. On this page you can see the AbstractMap documentation

    
answered by 08.11.2016 / 07:16
source