Questions tagged as 'java'

1
answer

Guess number with Java with while loop and with attempts

I have done this program with Java, that the user has to guess the number with 5 attempts, the number is 6, but the second attempt hangs up import java.util.Scanner; public class Practica15 { public static final int NUMERO_SECRETO = 6;...
asked by 17.10.2017 / 09:40
3
answers

In java the integer data types are applicable in the for each loop?

I have searched for examples to understand the for each loop and most examples only show using the type String for example declare a array type String and then use the loop for each . Well, the point is that...
asked by 05.09.2017 / 08:51
1
answer

I get two different values when converting a String to SHA1

I have the following code with which I am trying to encrypt passwords with SHA1. I have used code adapted from two different sources but both bring different results. import java.io.UnsupportedEncodingException; import java.math.BigInteger; im...
asked by 13.09.2017 / 19:48
1
answer

give a square style to the Android textview

Dear, I have to give you a style similar to this mockup But the text view that I have are these <TextView android:hint="@string/Reference" android:layout_width="match_parent" android:lay...
asked by 11.08.2017 / 15:12
2
answers

Why do I get the total of the characters as a result?

The idea is to count the number of times a letter appears in a sentence; in this case it is b, but it gives me as a result the total of all the letters char x='b'; String y="hola"; int n=0; for(int i=0;i<y.l...
asked by 28.10.2018 / 18:24
1
answer

3-wire sum

I hope you can help me, I have this thread problem ... Create a program that evaluates    p = Σfrom i = -100 to 100 (sin (i)) + Σfrom i = -100 to 100   of (cosine (i)) + Σfrom i = -100 to 100 of (tangent (i)) For each term in the equation...
asked by 26.10.2018 / 00:46
3
answers

Create ArrayList, add several data to the same array from other classes and print them?

Finally, with the help of my teacher, I was able to achieve it, I attached the source code. package prueba2; import java.util.Scanner; import java.util.ArrayList; public class Concesionario { public static void main(String[] args) { List...
asked by 22.06.2017 / 03:51
1
answer

Report Crash android.os.FileUriExposedException on Android N

With the update of the google play console I get the error reports. Apparently only affects the version of Android 7 (Android N) java.lang.RuntimeException: at android.app.ActivityThread.deliverResults(ActivityThread.java:4525) at andr...
asked by 19.05.2017 / 19:54
4
answers

not suitable method found for add (Java)

I am trying to create a small program that generates random bets to the Quiniela. It gives me error in  listaquiniela.add (object.generarapuesta ()); Quiniela class import java.util.*; public class Quiniela { ArrayList < Apuesta &g...
asked by 22.05.2017 / 15:23
2
answers

Capture a QRCode with the ZXing library on Android

I try to make a reader QRCode using the library ZXing but I can not find the necessary dependencies to embed and a basic example for start. I want only that the camera with the red bar comes out and returns the QRCode scanned. I j...
asked by 15.06.2017 / 18:53