Questions tagged as 'java'

3
answers

Separating text from a string into an array

I need a way to separate a string like the following:    "0.1253729 09863637 02937382 029828020" I want to remove each of the information and store it in an array . obs: I'm reading from .txt file .     
asked by 08.08.2017 / 20:05
3
answers

Code line ignored [duplicate]

The line marked with /*ISSO AQUI*/ is being ignored, ie the name for the second employee is not read, only the last name. import java.util.Scanner; public class EmployeeTest { public static void main(String[] args) { Scanner in...
asked by 27.02.2017 / 18:23
6
answers

How to "call" this correctly?

When Elements are within onCreate , using (this) is very easy ... Example 1: that works from within onCreate itself protected void onCreate(Bundle savedInstanceState) { Spinner spinner = (Spinner) findViewById(R.id.memo_confirmat...
asked by 27.01.2017 / 11:06
1
answer

Inheritance at compile time?

I was reviewing some codes and some concepts when I found the following assertion:    The inheritance mechanism in Java occurs at compile time, that is,   reuse of code by inheritance is unchanged in   run time I spent a lot of time tryin...
asked by 21.11.2018 / 19:04
1
answer

Difference between HashMap and TreeMap

What are the main differences between HashMap and TreeMap ? In relation to the use, in which situations is the use of each one recommended?     
asked by 08.11.2018 / 12:12
3
answers

Does the File (String) constructor create a file?

When we use the constructor File f = new File(aquiVemOEnderecoDoArquivo) method, if the file does not exist, is it created?     
asked by 04.12.2018 / 14:04
2
answers

What does "serialVersionUID" mean?

Eclipse suggested that I put this snippet of code: /** * */ private static final long serialVersionUID = 1L; I would like to know what the purpose of it is ... If anyone can explain it to me, I will be grateful.     
asked by 07.11.2015 / 23:53
1
answer

Call a method that calls another method of the same class?

Example I have the class Metodo : public class Metodo { private String string; public String mostrar(String nome, String sobrenome){ this.string = "Nome: " + nome + "Sobrenome: " + sobrenome; return string;...
asked by 13.11.2016 / 14:21
1
answer

Class Rectangle, is there a circular class?

I know that Class Rectangle is in rectangular form for object collision, is there a Circular class for that purpose?     
asked by 01.06.2016 / 17:32
2
answers

Doubt, regular expression in java

I have the following regular expressions. The first valid words and you're right. The problem is in the second that is to validate directory, such as " home/PauloNeto/NetBeansProjects/Expre/src/expre/texto.txt ". I can not get her to valid...
asked by 08.11.2015 / 20:34