Questions tagged as 'java'

1
answer

Recursion in Java - MDC

How can I implement a counter in the code below to be able to know how many recursive calls will happen to calculate the MDC of 14 and 18? package Aula01; import javax.swing.JOptionPane; public class Exer01 { public static double mdc(do...
asked by 25.02.2018 / 22:01
1
answer

Find all occurrences of a pattern in a String

I need to use regular expressions to find patterns in a text. It would be better for me if there were a method equal to search() of Python, which returns a vector with all occurrences of that pattern. Is there a similar method in Java?  ...
asked by 19.02.2018 / 21:45
1
answer

Creation of a Fahrenheit to Celsius degree conversion table

Write a program that gives two temperatures in degrees Fahrenheit (integer values) produces a table with all values in that interval half a degree Fahrenheit. For example, running the program for values 30 and 35 should produce the following out...
asked by 28.10.2017 / 13:23
2
answers

Help in spacing between EditText

I can not give a space between EditTexts in my project. the amount of EditTExts is generated according to the amount entered by the user, that is, it has been programmed in the Java Code. : //i.stack.imgur.com/lfOAW.png ">     
asked by 29.10.2017 / 22:13
1
answer

How to enter a value in the prompt box?

I need to access a webpage through the WebView component. 1- I can load the page. 2- I can intercept the button event. I can not insert / inject var name = prompt("Introduza o numero:"); Note: The page is only available...
asked by 07.11.2017 / 16:07
1
answer

Text break by delimiter

I have the following text: Texto|Texto|Texto| I want to display it in a TextView, but every "|" (pipe) it will break the line. In this way: String texto = this.textoQuebrado; String[] array = texto.split("|"); conteudo.setText(...
asked by 20.10.2017 / 13:26
1
answer

How can I split the parcels by adding just exact values for each parcel, and will one parcel be left with an extra value?

Example: The division of 100 (entry value) by 3 (quantity of parcels) is equal to 33.33, where 3 * 33.33 = 99.99. Being that the right is to stay a parcel with the value 33.34. Java code public void parcelar() { listaParcela = new...
asked by 22.10.2017 / 04:37
1
answer

How to find out if an ImageView has an informed photo

Hello, I want to create a conditional that checks whether all the fields on the screen were informed by the user or not. If anyone has not been informed, I would like to submit a toast showing the error. The problem is that on this screen I have...
asked by 22.10.2017 / 22:44
2
answers

Doubt over access modifiers and polymorphism

I have a very early question about polymorphism / access modifiers in Java. I would like to find out why a certain phenomenon occurs in my code. Here is an example of classes: Class Pai : public class Pai { public void metodo1(...
asked by 09.11.2017 / 19:00
3
answers

JSON handling with JAVA

Through JAVA, I need to make a request via POST, where I get a JSON with a token. The JSON return I get after sending the POST is this: { "Token": "e27bb0a7-e65b-4cc3-a82e-7a2a3c26a248", "Codigo": 0 } How do I make t...
asked by 14.11.2017 / 13:54