Questions tagged as 'java'

3
answers

Encapsulating the properties file in a class is a good practice?

In other languages like Python it is possible to perform programming logic in the configuration files and in Java this is not allowed because it is a compiled language. I decided to encapsulate the settings of the .properties file in a...
asked by 27.02.2014 / 13:25
2
answers

Root with BigDecimal

I'm breaking my head to turn a root into a code. I know it works something like this: Math.pow(625, (1.0/4)) = raiz 4ª de 625 = 5 My headache is that my data is BigDecimal s Sting prazoIn = idtText.getText(); BigDecimal prazo...
asked by 02.11.2017 / 02:32
1
answer

Doubt about System.currentTimeMillis ()

I was discussing with a friend now little about the origin of the number that results from this method. Where does he come from? Has he been told since? Does it reset ?     
asked by 05.11.2017 / 04:50
1
answer

Primefaces DataTable Lazy - Table does not display records

I'm creating a lazy datatable, but although the load of the class is loading the records correctly, the table remains empty. XHTML: <p:dataTable value="#{chamadoMB.chamados}" var="c" paginatorTemplate="{RowsPerPageDropdown} {FirstPa...
asked by 13.12.2013 / 14:10
1
answer

Raw String Literals Java

I saw that in JDK 12 it is possible to make raw string literals similar to some programming languages like C #, JS, R etc. Ex in C #: "Essa não é uma \n raw string"; Output: Essa não é uma raw string @"Essa é uma \n raw string";...
asked by 28.11.2018 / 05:15
2
answers

Uploading android images to folder on Server

How can I upload an android image to a folder on the server? I have the address of the folder that I can use to save image, I am already using this address to be able to take the images, but now I need to save images to that folder of the server...
asked by 07.10.2014 / 14:55
1
answer

Pass variables value between Classes

I would like to pass the values stored in the variables from part1 to part2 to validate the highest value typed. PART 1: public class SEP_06_parte1{ public static void main(String args[]){ System.out.print("Digite 10 valores ");...
asked by 06.10.2014 / 16:40
1
answer

How to execute requisitions in order?

I make 3 requests in a row, but they are triggered in order of processing, not synchronously, how can I solve this? ... //botão pressionado // primeira requisição ivUpload.setOnClickListener(new View.OnClickListener() { @Override...
asked by 30.03.2017 / 03:45
2
answers

Create a string resource or a class of constants?

I have an application where I use data persistence with SharedPreference . From the beginning when I started creating applications, I have always created a class, for example, with name Consts to store variables of type static fi...
asked by 30.03.2017 / 03:51
2
answers

Java + Firebird connection returning Null

My connection string with the firebird database returns null. Below is code: public class ModuloConexao { public static Connection conector(){ //criação da varáivel conexao Connection conexao = null; //chamada...
asked by 18.05.2017 / 22:09