Questions tagged as 'java'

1
answer

How to have an ArrayList by composition

I understand how to do composition but I have never done with lists, although the principle should be the same, I do not understand how to do it. To start I have a class CentroComercial that has a ArrayList called lojas w...
asked by 15.04.2018 / 16:47
2
answers

Difficulty with FOR loop nested

I am creating a code to develop my studies in Java and gave me an interesting idea / challenge: One person has 5 cards from MegaSena and always plays with the same cards. I made a small code where you enter the numbers of the last draw and he...
asked by 05.06.2018 / 04:39
1
answer

Display JTable in multiple panels

How do I get my JTable displayed on all tabs within the panels? I can only display on the "Day 5" tab. import java.awt.Container; import java.sql.ResultSet; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swin...
asked by 08.04.2018 / 19:10
2
answers

Receive 3 random values and allocate in 3 variables from the lowest to the highest

I need to write a program that receives 3 random values and allocates the 3 values to 3 variables MINOR, MIDDLE, and GREATER. I tried something like this, but at the time of printing the values, I get the error that var A B C were not initialize...
asked by 10.04.2018 / 21:51
1
answer

"Column 'Value' not found." when fetching balance in query

I'm building an ATM simulator, with the Deposit, Draw, and Extract features functional. But I'm not getting the balance. I have the emitirSaldo() method that should receive the value calculated by the query. Here is the code: public...
asked by 12.03.2018 / 01:46
1
answer

Json Object for ListView

Good afternoon everyone, I have two classes, the bemVindo and the one that receives data in json and saves it in an object, and after the json data is received, the class sends the data to the bemVindo of the data received in St...
asked by 12.03.2018 / 16:49
1
answer

JPA Cascade Persistence

I'm trying to perform a cascading persistence using JPA. I have the entity: Course and Module 1 Course can have multiple Module @Entity(name = "course") public class Course extends BaseEntity { private static final long serialVersion...
asked by 09.05.2018 / 18:51
1
answer

What does it mean to put a type before a declaration? [duplicate]

Hello, I was studying HTTP Requests in Java when I came across a code and on a certain line there was a somewhat strange statement for me, can anyone explain to me what a type means before a statement? HttpURLConnection connection = null; U...
asked by 08.01.2018 / 23:24
2
answers

Return DataHora Updated Android

I made a class called DataHoraAtual containing this data: package com.projeto.projetov1.model; import java.text.SimpleDateFormat; public class DataHoraAtual { long date = System.currentTimeMillis(); SimpleDateFormat sdf = new SimpleD...
asked by 16.12.2017 / 23:28
1
answer

system with CRUD

I'm graduating in Systems and I'm developing a system, and my difficulty is to remove an element from an array, because the problem in question is that when it has more than one element it normally removes, but when it has one it does not remove...
asked by 11.12.2017 / 15:53