Questions tagged as 'java'

2
answers

Saving a list of elements with Shared Preferences

I'm creating a contact list and would like to save this list with SharedPreferences . Example: public class MeusContatos extends Activity implements OnClickListener { int pos=0; public static final String PREFS_NAME = "Preferences"...
asked by 23.04.2015 / 05:30
3
answers

Is it mandatory to put the same attributes in different constructors?

I have these builders: // 1st Builder - Create a bike with a new frame public Motociclo (String marca, String modelo, float peso, int robustez) { //Nivel 2 this.marca = validarMarca(marca); this.modelo = validarModelo(modelo);...
asked by 05.12.2018 / 19:59
2
answers

JAVA: What is the difference between OutputStream and getOutputStream ()?

I'm studying java and I came across various input and output classes, but I had a question about the difference between OutputStream and getOutputStream() . As far as I understand, getOutputStream() takes what you're going...
asked by 10.10.2017 / 20:57
2
answers

ArrayList declaration with type or without

I would like to know the difference in declaring a ArrayList like this: List<BancoPerguntas> listaBancoPerguntas = new ArrayList<BancoPerguntas>(); List<BancoPerguntas> listaBancoPerguntas = new ArrayList<>();...
asked by 31.03.2018 / 03:08
1
answer

What are the differences between Java SE, Java EE and Java ME?

I'm studying the Java Language in the Information Systems course and realized that the Java language is contained in our day day even without realizing it. It is present on both our computers and our mobile phones and our TVs. I know that the...
asked by 31.08.2016 / 17:35
2
answers

Word hunter can not find the word

Well, I'm trying to make a hunting game in java, but I can not find the word, can anyone help? Follow the code: import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; public class...
asked by 15.04.2015 / 21:18
2
answers

Problem with return of a Java method

This method is giving problem in return. An error message with the following statement missing return statement is appearing. Could someone tell me a solution? public String adicionar (String nome) { if(getNumLugares() < getNumDePassa...
asked by 29.10.2017 / 04:55
2
answers

Better applicability to make a functional interface

From Java 8, in order for an interface to become functional, does it need to have just one method? But we have the @FuncionalInterface annotation, which explicitly defines that this interface is functional. But what is the main difference in...
asked by 30.03.2016 / 06:42
2
answers

JavaFX application does not run on some computers after being exported to jar

I developed a JavaFX application, created an Ant script through build.fxbuild and generated a jar. The generated jar runs Ok on the computer in my service and on another developer's computer, however it does not run on two non-develope...
asked by 27.05.2014 / 23:49
5
answers

What is the difference between referencing an attribute directly or by get / set

As an example I have a private String atributo , so I can have two ways to reference it, internally in the class: this.atributo And also: this.getAtributo(); Is it correct to say that it is wrong to use this.atributo and s...
asked by 19.05.2016 / 04:14