Questions tagged as 'java'

3
answers

Always get the last three characters without knowing the size of the String [closed]

I want to get the last three characters of a String . Example: String x = "OlaMundo" Output: ndo I can even do this using substring , the problem is that I do not know the size of String , I do not know what the wor...
asked by 11.12.2018 / 22:21
1
answer

Tabhost does not call the onTabChanged () method

Because when triggering the Tab does not call the method onTabChanged() . public class MainActivity extends TabActivity { private TabHost mTabHost; @Override protected void onCreate(Bundle savedInstanceState) { supe...
asked by 05.06.2014 / 01:39
2
answers

How to read a txt file store value in integer type?

I'm using this example: try { AssetManager assetManager = getResources().getAssets(); InputStream inputStream = assetManager.open("nome-do-arquivo.txt"); InputStreamReader inputStreamReader = new InputStreamReader(inputStream);...
asked by 03.03.2016 / 19:51
1
answer

Code prints twice but should print only one

I would like to know why I run the algorithm on the screen, the line that asks for the student's name to be printed twice. Scanner input = new Scanner(System.in); System.out.println("Quando o tamanho do conjunto de alunos"); int tamanho =...
asked by 28.09.2014 / 05:00
1
answer

Split Array into Multiple Threads

I need to make a Query in my Database, which will return each of the Lines. However, for each of them, during the Retorno, I have to wait about 5 seconds, because it is the time that I have to wait for Ping to complete and return to me if the Ho...
asked by 23.11.2018 / 01:28
2
answers

How do I remove a band by its name?

I can not get the bands inside the arraylist. For this, I read the .txt file where the information (name, country, nrointegrantes) is stored. I did a split to access the name, but when I try to remove one of the bands by the name I'm not getting...
asked by 13.11.2018 / 02:56
2
answers

HashMap to get a value

I have the following code: it is to count how many seconds I take to type a sentence. If I type BABA the result is 10. BUT I WANTED THAT WHEN THERE WAS THE JUNCTION OF THE LETTER 'Q' + 'U', (AS IN THE WORD CHEESE), HE CONSIDERS A VALUE ONLY AND...
asked by 11.11.2018 / 04:07
1
answer

How to include the unit test artifacts in a simple Java application?

This is my project in my repository; DESIGN Look at the pom.xml file <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc...
asked by 26.12.2018 / 20:31
2
answers

How to install Java EE perspective in Eclipse?

I want to start studying Java for web (Servlets, JSP, EJB, Servlets and JSP). I already have installed Tomcat, JRE, JDK 7 and Eclipse Kepler Standard. How do I configure Eclipse to add the JEE perspective via plugins? I need to add the Enterp...
asked by 10.03.2014 / 07:23
1
answer

Am I doing this exercise right?

So far I've been able to do it, but the imprimiAgenda() method is printing, but at the same time giving null pointer. And I also want to know if my logic is going well. If you can help me, I'd appreciate it! Another question, how do I get...
asked by 29.06.2018 / 19:26