Questions tagged as 'java'

1
answer

I need help with replaceAll for monetary values!

String sal = "1500,32"; double salario = 0; sal.replaceAll( ",", "."); salario = Double.parseDouble(sal); Can anyone explain me better about replaceAll? is giving error!     
asked by 08.09.2017 / 19:34
1
answer

Upload Image with Socket Java [closed]

I need to make a program capable of sending an image to a server (my pc for testing) at the push of a button, I already know how to select the file, but I can not find anything on the internet to help me in sending. Does anyone know, or do you h...
asked by 04.07.2017 / 21:45
1
answer

Place access permission with access restriction

I'm using a code that was already done by someone, I made some modifications about what I wanted. This code has 2 types of access "Administrator and Official" would like that when the person entered with the login of type Employee it could no...
asked by 04.07.2017 / 14:45
1
answer

How to return the values of an arraylist in Java

I can not return the arraylist values. I created a Student class with some methods. In another class I create a Student-type arraylist and add values. But when I show it, nothing appears. I used foreach to traverse the array. import jav...
asked by 06.10.2017 / 20:04
1
answer

incompatible types boolean can not be converted to Users

I am creating a function to insert new users into the database, but I have this error: "Incompatible types: boolean can not be converted to Users". Does anyone know a way to solve this case: public String InsertUserCpf(@PathParam("nome")String...
asked by 06.10.2017 / 19:58
1
answer

How to end an activity from another class?

I need to close an activity if it has opened, when a particular timer finishes, how do I do that? because to use the finish I need context. I tried to cast, but to no avail: if (dados.getvideorodando()){ try { ((Video2)getApplicationC...
asked by 06.10.2017 / 01:42
2
answers

Consume web service

I come as an idea of deploying on a system that I am putting together a web service, where the user informs the zip code, and the address fields if they complete. However I do not think anything about how to do this in desktop applications....
asked by 14.09.2017 / 05:13
1
answer

Android and Stream Java 8

Gentlemen I made a simple code to filter a list by passing the Id and the goal would be to return an object. To make use of the stream I configured the libim annimon: stream and backlamb, I would like a critique of the code below, since it is my...
asked by 05.08.2017 / 00:20
2
answers

Error when using a final static String to construct a SQL query

Good evening person, I've been searching around and I know what to do to get CRUD organized ... I know that the programmer creates a class with the strings, leaving for example public static final String NAME_TABLE = "nome"; and so on, th...
asked by 20.06.2017 / 06:39
1
answer

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById (int)' on a null object reference

I have a fragment that through one button it will call the other fragment. But the following error is appearing. 06-20 19:12:12.075 17971-17971/com.example.gerdaumanagement.gerdaumanagement E/AndroidRuntime: FATAL EXCEPTION: main...
asked by 20.06.2017 / 21:19