Questions tagged as 'java'

2
answers

Android Studio problems when sharing mp3

This is my code: peroperoperopero.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { Intent compartirAudio = new Intent(android.content.Intent.ACTION_SEND); co...
asked by 05.10.2018 / 07:32
2
answers

How do I solve this error when I perform a crud in spring boot?

I have a problem when I click on update a window appears and there I update the data but instead of updating it I create another record I do not know what to do next I leave the code: Model user class @Entity public class User extends A...
asked by 17.07.2018 / 00:38
1
answer

Hibernate @ManyToMany doubts

I'm quite a rookie as far as Hibernate is concerned, the fact is that looking at the documentation of the annotation @ManyToMany a question has arisen, which is quite appropriate to my case, and is as follows: Let's say the case that I...
asked by 11.08.2018 / 22:40
1
answer

Access another class via threads in Android Studio?

Hello I have a project in android studio which saves the user's location (longitude and latitude), for this I have created a series of methods in a single Activity, now what I need is that when the user changes activity I follow saving the locat...
asked by 13.08.2018 / 20:00
1
answer

Problem with For Loop and Socks

I have had a problem when doing an exercise that asks the user for the number of temperature values taken (it must be greater than 0) and then ask for temperatures and return the number of times it has a value less than zero degrees and the aver...
asked by 14.10.2018 / 14:27
1
answer

Mini-Max Sum Hacker Rank

package solution; import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class Solution { // Complete the miniMaxSum functio...
asked by 11.08.2018 / 20:03
2
answers

Validate a string only with the letters a and b, and containing at least one space

Hello community of StackOverflow, I commented that you have to validate a string entered from the keyboard that should only contain the letters a and b and have at least one space. With the code I have so far there is no problem with chains of t...
asked by 12.10.2018 / 07:04
0
answers

Click RecyclerView - Item

I need to click on an item in a RecyclerView but when I try to do it it shows me the following message: java.lang.NullPointerException: Attempt to invoke interface method 'void com.example.zero.test.Interface.ItemClickListener.onClick (androi...
asked by 14.10.2018 / 06:10
12
answers

How to correctly compare Strings (and objects) in Java?

I am creating a mini game in which the user tries to guess a name. But when I want to compare two text strings to see if they are equal it does not seem to work. final String miNombre = "Jordi"; Scanner input = new Scanner(System.in); System.o...
asked by 02.12.2015 / 13:35
1
answer

Filter by class without using stream when reading an array of objects with Java lambda expressions 8

I'm testing the Java 8 Lambda expressions. In my code I create a list of objects that can be of type Person or type Employee . The class Employee extends from Person and I want, using a lambda expression to displ...
asked by 07.07.2018 / 06:48