Questions tagged as 'java'

2
answers

... on a null object reference

Hello, I'm at a time with this problem and I can not find a solution, I've already looked at thousands of topics and I still can not understand why this error appeared for me. Error java.lang.NullPointerException: Attempt to invoke virtua...
asked by 27.09.2017 / 05:48
1
answer

Error when using Random in JAVA

When I run this code: public class main { static boolean terminar = false; public static void main(String[] args) { long init = System.currentTimeMillis(); BruteForce(true, true, "a123", 10, 10000); lo...
asked by 07.07.2015 / 06:24
3
answers

Error using LIKE to search by name

When I used Mysql I could use LIKE ? to do searches by name, code, etc ... Now in SQL Server I can not. I have a TextField and a search button, I want to get the value of the textField and move on to the search. I'm trying to do it thi...
asked by 17.06.2015 / 19:09
2
answers

Static enum constants

enum Animals { DOG("woof"), CAT("meow"), FISH("burble"); String sound; Animals(String s) { sound = s; } } class TestEnum { static Animals a; public static void main(String[] args) { System.out.printl...
asked by 15.12.2015 / 01:11
2
answers

Problem with hasNext () Java

Hello, I have a problem, I do a Scanner to a txt file, then I invoke a method to go to count the lines of this file, after I return the number of lines (to give the size to the String Array equations), I want to go back again go through the file...
asked by 07.01.2016 / 15:58
2
answers

Error generating custom Listview

Hello, I'm trying to implement a custom ListView on Android, but I'm not getting it. It's something simple, I've done it before, but I can not see where I'm wrong. Adapter_Bluetooth.xml : <?xml version="1.0" encoding="utf-8"?&...
asked by 06.08.2015 / 15:56
1
answer

How do I create an event the moment someone types something in EditText? [closed]

I would like to create an event as the user is typing a word in my EditText , but I do not know how to access it.     
asked by 02.01.2017 / 23:45
1
answer

How to split a string and then convert to int?

I have a string "1 2 3 4 5" to split it and save the numbers into separate variables I was reading and saw that it has to use a method called Split ... I tried to do but I could not. How do I do this, and then how do I convert to int the resu...
asked by 03.08.2015 / 03:00
1
answer

Accuracy error in account with BigDecimal

I have the class below which has a different value than when I use the calculator. I searched on BigDecimal , but I must be missing something when submitting the result. What I have to do is:    4.5% of 8410 = 378.45 But using th...
asked by 09.12.2016 / 17:00
2
answers

How to convert a string with minutes / month / year in TimeStamp?

I am making a test code only. In it, I have the following String : String tempo = "1s"; //1 segundo This string is modified all the time: String tempo = "30d"; //30 dias So, I want to convert this string which can be s(segun...
asked by 10.12.2016 / 16:25