Questions tagged as 'hashmap'

1
answer

Problem does not work setOnChildClickListener in ExpandableListView

I have an ExpandebleListView as a menu in a navigationDrawer, I need to add event listenes to the child items, however I do exercise for each parent and child group, in the parent groups you can get the position with setOnGroupClickListener fo...
asked by 27.10.2017 / 17:42
1
answer

E / AndroidRuntime: FATAL EXCEPTION: main, java.lang.NullPointerException: println needs a message

I have the following code: package org.jcloarca.laboratorio2; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.Ed...
asked by 22.05.2016 / 00:34
1
answer

Go through and return a Java HashMap in order

I have the following HashMap Map<String, Float>notas = new HashMap<String, Float>(); notas.put("Examen 1", 8.0F); notas.put("1er trimestre", 9.4F); and I have the following method to go through it and show it on the screen @Su...
asked by 01.11.2017 / 21:45
1
answer

Serialize and deserialize objects and properties in Java

I have a problem with the serialization and deserialization of objects in Java, and I think it's because I do not really understand how it works. My program consists of some spreadsheets as in Excel, but by console. I have a class "Book" and a c...
asked by 08.12.2018 / 18:57
1
answer

hashtable classes and hashMap help! [duplicate]

I must implement a system for viewing and updating student data. At the beginning the system must load the data of the file students.txt and show the following menu: See data Search Student Exit To carry out this project, what is th...
asked by 07.08.2016 / 05:42
2
answers

Delete duplicate values in a Map / HashMap and get the most frequent value

I have tried to delete keys and values of a map but I have not yet achieved it, meanwhile I have created another map . It is required to find the words with the most appearances in a sentence. (I do not know what words there may...
asked by 30.06.2017 / 17:53
2
answers

How to use a HashMap with two Keys? [closed]

I need to create a HashMap whose access form is the combination of two keys.     
asked by 22.08.2017 / 04:17
1
answer

HashSet exactly how it works [duplicated]

Suppose I have this main: import java.util.*; public class Main { public static void main(String[] args) { HashSet<Persona> conjuntoPersonas= new HashSet<>(); Persona p1 = new Persona("Jose", "1"...
asked by 06.12.2017 / 12:26
2
answers

Obtain higher value element of a HashMap

I have a Hashmap which keeps the brand of the car and the times it repeats in a chain, Map<String,Integer> sh = new HashMap<String, Integer>(); If I make a route to Hashmap I get the following result: code: fo...
asked by 22.06.2017 / 10:56
1
answer

Compare values between two HashMap

I have two HashMap in my code HashMap<Long, Double> partesTrabajoIdHorasDb = new HashMap<>();//ID+horas HashMap<Long, Double> partesTrabajoIdHorasLocal = new HashMap<>(); The first Hashmap    par...
asked by 06.03.2018 / 17:09