Questions tagged as 'java'

2
answers

How to instantiate Strategy objects

Consider the basic implementation of the Strategy pattern. public class Context{ private Strategy strategy; } public interface Strategy{ void algoritmo(); } public class ConcreteStrategyA implements Strategy{ void algoritmo(){ //...
asked by 14.12.2018 / 16:12
1
answer

How to uncheck a CheckBox when marking another?

I wish this could not happen. The user clicking on the other CheckBox , deactivated the one previously marked. MainActivity.java package genesysgeneration.umouoto; import android.support.v7.app.AppCompatActivity; import an...
asked by 10.01.2017 / 01:27
1
answer

Android - Comparison between string and varchar [duplicate]

I'm having trouble comparing strings. One retreat from one EditText and the other from an SQL table. The app consists of a game of the genre " Who wants to be a millionare? " When it arrives at the if cycle of comparison between the two s...
asked by 07.12.2016 / 19:37
2
answers

Eclipse UTF8 configuration [duplicate]

Does anyone know how to configure eclipse for utf8? I searched for settings but still could not find     
asked by 02.07.2016 / 16:58
2
answers

Catch information from multiple files in a directory

I'm doing a Java application that takes information from several *.tif files in a directory, but I can not get information from more than one at a time and need to put the specific path of each file. I'm using Paths for this. If...
asked by 29.06.2016 / 14:07
2
answers

How to know the number of files in a folder using Java?

In short, given a path that is a system folder, the return is the amount of files directly in the root of the folder (you should not consider files in subfolders). This would be used in an iteration with for to access the files to do a "parse" (...
asked by 16.10.2016 / 05:29
2
answers

How to create a folder with the current date name

I'm trying to create a folder with the name equal to the current date but it just does not create. import java.util.*; import java.io.File; public class PastaData { Date data = new Date(); SimpleDateFormat formatar = new SimpleDateFormat("d...
asked by 03.11.2016 / 22:56
1
answer

Error when doing email query in the bank

I am getting an error in NetBeans when doing a query in a SQL database that validates the user login from the email: package Modelo; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQL...
asked by 17.08.2017 / 12:25
3
answers

how to send 2 values to the php get & get http // localhost / ... php? kk = par1 & zz = par2 ";

Hi, I'm having a problem with my web server, and I'm having problems with the web service. ... but I need to assign this to the url of the code ... I thought I had it but somehow my list goes back empty and does not return anything via gson .......
asked by 08.04.2016 / 20:15
2
answers

How to pass variable by parameter created in enum in Java?

I created a class enum of java public enum Cor { AZUL(1),VERMELHO(2),VERDE(3); private int var; Cor(int var) { this.var = var; } } In main I will create a menu using do/while and switc...
asked by 09.03.2016 / 19:03