Questions tagged as 'java'

2
answers

Adding new fields dynamically

I'm creating an app that calculates credits from a school report. DUVIDA : How to add a new EditText when the user clicks the next "+" button and sums the values of each EditText .     
asked by 11.09.2016 / 05:17
1
answer

Classes that implement interfaces are considered subclasses?

I have an interface Veiculo , a class Peugeot that implements Veiculo . This Peugeot is considered subclass?     
asked by 12.09.2016 / 02:47
1
answer

Generic Tree, how to do?

I'm trying to mount a Generic Tree in java to mount a Boolean expression inside a genetic expression algorithm, this tree would store several types of variables, I'm not sure which is the most optimized way to do this, I was thinking of saving l...
asked by 03.07.2014 / 23:13
1
answer

What is the difference between String name="test" and String s4 = new String ("Peter");

What's different about assigning a value to the variable by creating an object and assigning unboxing to a direct value? String s4 = new String("nome"); String nome = "nome"; System.out.println("nome == s4 " + (nome == s4)); //retorna fals...
asked by 05.09.2017 / 04:07
1
answer

Creating a timer with JAVA

I need a help here, I want to make a timer with JFrame but I can not get it to repeat until I get to zero, and if I leave setRepeats to true I can not make it stop when it reaches zero import java.awt.event.ActionEvent; import java.awt....
asked by 14.02.2014 / 18:19
2
answers

Convert a collection of type Set to List

I have a class that has an attribute of type Set, because I want repeated values to be ignored, however I need to return this in List form to fill in a ListView , so what is the best way to implement this feature? Reader.java packag...
asked by 12.08.2015 / 19:52
2
answers

What is the best (faster) way to read a file from a web server?

I need to read a file on a web server, but when I need to store the content in an array of bytes it's taking too long. Does anyone know a faster way to do this? follow my code. Thank you in advance. try { url = new URL(surl);...
asked by 26.10.2015 / 15:15
3
answers

What is a servlet and what is it for?

I've heard a lot about the term servlet , but I still can not understand it. What really is servlet ? What is it for? What is its applicability in practice?     
asked by 09.10.2015 / 19:11
2
answers

Calculator with Java Graphical Interface

I started working with the Swing framework, creating a calculator with JOptionPane , and I did it normally. Now I have the challenge of inserting the buttons in the calculator, the + , - , * and / problem is that I researched a lot an...
asked by 10.04.2014 / 07:36
1
answer

Encapsulation and Java Access Modifiers

A very simple question: Given this class: public class User { private String nome; //get/set public boolean fazQualquerCoisa(){ **duvida**.equals("algumacoisa"); } } Within the method Does AnyCase () , should I access the n...
asked by 05.05.2015 / 16:36