Questions tagged as 'java'

6
answers

Hibernate is not creating the tables

I'm new to Hibernate, because of the little I've learned, I believe I did everything right, that is, I downloaded the dependencies, I wrote down the classes, etc. Below is my example class: package br.com.evolutionary.modelo; import javax.per...
asked by 12.05.2016 / 01:18
2
answers

Generate random data within a range

I can not return any number. Ex: If you use "minor 1500" and "greater 5000", it was to appear in this range if you did not enter while , only it is not returning anything. public int aleatoriar(int maior, int menor) { int retorno...
asked by 14.03.2015 / 20:03
2
answers

How recursion occurs in the following code

I would like to understand, because I can not mentally glimpse what happens in the excerpt: return fat * factorial.fatorar (fat-1) ;, the question of recursion, regarding the calls of the factorar method itself in relation to multiplication with...
asked by 16.04.2016 / 02:48
3
answers

What is the best method for exceptions?

What is the best method to catch exceptions in an Android app, type try/catch , throws or throw . Type exceptions, fields that the user left blank on a form.     
asked by 25.09.2015 / 07:18
3
answers

Strange value when printing array

In java , I'm having difficulty understanding some concepts. On a .jsp page, I have the following code:    String [] arrayRegioes =   request.getParameterValues ("numRegiaoUsuario"); // object When I print the array, the value...
asked by 24.03.2016 / 13:51
2
answers

How does the equals method work?

I stopped in an exercise of a book I'm reading and in this shows an example of overloading the equals method, I even understood the concept that it compares the reference between two objects, but in the method: public boolean equals(Ob...
asked by 02.02.2016 / 02:59
2
answers

Error connecting to sql server database with java and problem with connection string

I put the jar and did the build path. I've been trying for some time to connect to the microsoft bank but it gives this error: Exception in thread "main" java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: Falha na...
asked by 25.02.2016 / 04:58
2
answers

How can I test method with void return using JUnit?

Is it possible to perform automated test, in Java , of a method that has void return using JUnit ? If yes, how is it possible?     
asked by 24.03.2016 / 20:09
2
answers

Error saving SQLite data (no such table)

DatabaseHelper class: public class DatabaseHelper extends SQLiteOpenHelper { private static final String BANCO_DADOS = "MakeRequestApp"; private static int VERSAO = 1; public DatabaseHelper(Context context){ super(context, BANCO_DADOS, nu...
asked by 29.01.2017 / 14:17
3
answers

How to repeat a minute-by-minute notification

I'm creating a app Simple receiving a notification every time I click a button of my layout , everything works perfectly. Now I want this notification be repeated for example every minute until I disable it. Can anyone give me a hint how can...
asked by 02.02.2017 / 19:35