Questions tagged as 'java'

2
answers

OutOfMemoryError: Java heap space

I have the following code: class Main { public static void main(String[] args) { Lista chamar = new Lista(); String[] vetor = {"Palavra", "Letra"}; chamar.adicionar(vetor); } } class Lista { ArrayList<Str...
asked by 12.04.2014 / 19:09
2
answers

Regex to get numbers between the second and third "/"

Let's say I have the following String / Product / 976935 / How would I do a regex to return only the numbers between the second and third bar? The number of numbers varies so it does not matter to return only the numbers     
asked by 12.03.2014 / 13:39
1
answer

Working using Thread

I'm doing a college job who has to be used thread . But I've never used it and I'm still learning. My intention is, when you press the up key on your keyboard, startar the thread to make an event. But you're making a mistake that I can not...
asked by 08.06.2018 / 16:58
2
answers

What tools should I use to create an android application

I'm starting in the mobile development that will be done in Java or Kotlin and my question is what tools can I use in both the design part and in the database what are the main technologies?     
asked by 11.05.2018 / 23:51
1
answer

Replace empty line

I have a variable with the following content: 10 20 30 40 50 60 70 80 90 100 There are spaces (may have 2 or more followed) and line breaks (also several in the sequence), and I want to substitute to stay this way: 10 20 30 40 50 60 70...
asked by 26.04.2018 / 20:48
2
answers

Application closes at the touch of the button

When one or more EditText s are empty the touch of the button should show the Toast message, but the application closes. Why? public class HomeActivity extends Activity { int rcpNum, fckNum, abtmNum, mucBritaNum, meCimentoNu...
asked by 14.12.2014 / 23:51
1
answer

How to set values of an array attribute?

I have a java class that represents a snack , below the class: public class Lanche { private String nome; private int id; private double preco; private String[] ingredientes; /*getters setters */ } Below is the test class i...
asked by 18.03.2018 / 18:48
1
answer

Higher and lower value

   Make a program that receives a set of integer and positive values and that calculates and shows the highest and lowest value of the set. (To close the entry, you must enter the value zero.) I know the part of the smallest value is wrong,...
asked by 23.03.2018 / 04:04
1
answer

Eclipse error of non-recognition of static and default modifiers

Galerie eclipse does not recognize when I want to create a class within an interface with static and default modifiers. Note: I already have JAVA 8 jdk installed. Right now, thank you very much. Att, Thiago Marques.     
asked by 30.08.2016 / 23:10
2
answers

How to handle an empty string?

I need to convert a string that I get from a text file and populate a person class where, each attribute of the class is separated by "," in the text file. The attributes are only: height, weight, age. In the text file they are as follows: 1.5...
asked by 03.09.2016 / 22:49