Posts by hinoago • 66 points
7 posts
-
0
votes0
answers22
viewsQ: How does the <class> tag work in the persistence.xml file in jpa?
Good night. I’m starting in jpa studies, and in a moment I came across the following situation, I filled in the persistence.xml file as follows: <?xml version="1.0" encoding="UTF-8"?>…
-
0
votes1
answer46
viewsA: Problem with a Char vector in Java
You have to play the assignment for the value received by the scanner out of the conditionals. So: import java.util.Scanner; public class Teste{ public static void main(String args[]){ Scanner sc =…
-
1
votes2
answers56
viewsA: Search string inside Java list
You can use the stream api to work your data, for example: import java.util.stream.Stream; public class Nomes{ public static void main(String args[]){ String[] nomes =…
-
0
votes2
answers123
viewsA: Check if Java List has duplicate object attributes
Since there is no way to use stream to filter the data, Voce can do so: import java.util.ArrayList; import java.util.List; public class Teste{ private String nome; private int id; public…
-
0
votes2
answers33
viewsA: Why do I try to divide the value of 0?
To have the average of minimum wages on top of the user’s salary Voce has to divide the user’s salary by the minimum wage. And also Voce is using int, it rounds the value down. Ex: 10/6 = 1. For an…
-
0
votes2
answers123
viewsA: Check if Java List has duplicate object attributes
You can use a stream to filter the attribute you want to check and print each of them in the list. Ex: public class Teste{ String nome; int idade; public Teste(String nome, int idade){ this.nome =…
-
1
votes1
answer45
viewsA: Error declaring Java constants
In fact it is the following, as Voce is in the main method, Voce cannot define public attributes, and therefore within a (main) method Voce cannot define class attributes(Static). That is, if you…