Questions tagged as 'java'

1
answer

String Validations

I've been researching how to validate e-mail, dates, hours, etc. And in the case of email, I found a code like this: /^.+@.+\..{2,}$/; . He is incomplete. But I wanted to understand what these symbols are, and what do they represent to val...
asked by 28.05.2016 / 04:39
1
answer

How to store data in RAM and make it available to any module or class in my application?

There are several ways to store data for a given application, and some of them are: Disk Storage (HD). It can be a text file, XML, or a database file of some DBMS. Cloud Storage. It has some services that allows store data for a Cloud appl...
asked by 12.06.2016 / 15:14
1
answer

Problems with calculator operations made in swing

I need to make a calculator, which works like windows. I am having trouble at the moment the user can change the type of operation that he wants to perform. For example, if he typed 10 + and wants to change the signal from + to -, he clicks t...
asked by 28.03.2016 / 19:49
1
answer

java.lang.NullPointerException: Attempt to invoke virtual method [duplicate]

My program gave this problem when I tried to create a stack (database), to store strings in my Android app package com.project.meuapp2; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bu...
asked by 27.03.2016 / 20:39
1
answer

Query specified join fetching, but the owner of the fetched association was not present in the select list

I have a scenario with the following entities: Treinamento , Curso and Aulas . A Treinamento has a ManyToOne relationship for Curso . And Aula has a ManyToOne relationship to Curso . I want...
asked by 27.04.2016 / 17:54
2
answers

How do I delete a certain data from a listView?

The app has two buttons that when clicked add an item to a listView (bow and sword), but would like that if the item of each button was already present in the listView, it was deleted. package genesysgeneration.list; import android.support.v7...
asked by 17.02.2017 / 00:55
3
answers

Modify array elements

I need to create a query with the insertion of several lines. Change an array / list:    arrayOriginal = [10,20,30,40]     valueChave = 999 The return must be:    arrayNew = [(valueChave, 10), (valueChave, 20), (valueChave, 30)...
asked by 22.06.2016 / 23:21
2
answers

How to check for a null position in the vector

Why does if(array[i] == null) not correct? What would be the best way to check if that vector space is "empty"?     
asked by 23.06.2016 / 20:39
3
answers

Return the inverse of a vector

How do I invert the values of a vector? Example: 1 2 3 turn 3 2 1 I'm currently trying to make a method of type .. public static int [] vetorInvertido(int [] vet){ int [] vetInvert = new int[vet.length]; for(int...
asked by 20.05.2015 / 00:21
1
answer

Error in multiplication and division (java)

I'm having trouble implementing multiplication and division on my calculator with graphical interface. Regardless of anything I put using any of the operators (/ and *), the output result is 0. Sum and subtraction are working normally....
asked by 20.05.2015 / 03:44