Questions tagged as 'java'

1
answer

FileWriter and FileOutputStream: When should I work with each of them?

Often we find codes that could be solved by using objects of type FileWriter or FileOutputStream . For example, a simple code that writes " Teste " in the file /tmp/arquivo : With FileWriter : BufferedWriter o...
asked by 11.10.2016 / 08:02
1
answer

Compare geopoints with user geolocation

I'm using Google Maps API v2 in Android Studio and picked up the base code as available and only implemented a few points on the map, using latitude and longitude of points (% w / w). I also added the function to locate the user on the map....
asked by 06.10.2016 / 04:12
1
answer

What is the function of @Override in Java? [duplicate]

Viewing some code or even creating an automatic method I noticed the presence of it @Override . What does it actually do in the code?     
asked by 18.04.2016 / 19:37
1
answer

Removing reserved SQL words from a Java string

I'm doing a view that has an open field ( textarea ) where the user can write SQL and then can execute the same SQL. The question is that the oracle user where it will run SQL has permissions for everything and it is not supposed to d...
asked by 22.04.2016 / 18:17
1
answer

Change programming language to APK

I have an App in the PlayStore I made using the ionic / and for that reason I would like to create a new App from scratch using another programming language, my question is whether to create a new App in PlayStore or I can only update...
asked by 21.04.2016 / 19:20
1
answer

Data access object - DAO

I am learning design patterns and applying on a CRUD, within DAO can I just leave these code for SQL? public class UsuarioDAO { private Connection con = ConexaoFactory.getConnection(); public void cadastrar(Usuario usuario) {...
asked by 28.03.2016 / 20:25
1
answer

I can not register an ArrayList in Java

I'm doing a Java application (console). At the time of registering an arraylist even goes, but at the time of showing, it shows me trash. What do I do? Here is the code: Main class main: //classe main import java.util.Scanner; publ...
asked by 21.04.2016 / 21:05
1
answer

imageView.getDrawable () method throws NullPointerException

I wanted to get the drawable from ImageView and convert it to a bitmap. The conversion method I already have and is working fine, but when I request execution, it has the following error: Error Displayed: WhenItakethedirectimagefromtheDra...
asked by 03.03.2016 / 18:54
3
answers

How do I change a value of a variable within an if in java?

I created an abstract class called Player and also created the player subclasses. Now I need to create a menu for the user to choose which character he will use in the battle, but I can not create a new variable within if or change a v...
asked by 13.03.2016 / 01:24
2
answers

Regex - Regular Expression [closed]

I would like to know why the regular expressions I wrote are not correctly matching. The expressions are as follows: User name that must be unique and can not contain special characters ( %-$_#@ , for example), numbers or spaces, e...
asked by 14.01.2016 / 03:18