Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
-1
votes1
answer123
viewsRecyclerview inside another Recyclerview using Firebase Android data
I’m learning about android now, and putting into practice what I’m learning, but now I have a problem that I can not solve, or find exactly what I want My idea was to add a recyclerView in Vertical…
-
-1
votes1
answer69
viewsException error when running my code in Java
The following error appears when I choose the first three options I created in my code: Exception in thread "main" java.util.Unknownformatconversionexception: Conversion = '2' at…
-
-1
votes2
answers67
viewsSum of 3 matrices in a new matrix
I need a program that adds 3 matrices of Nxm size. The user should be able to set the size (Nxm) of the matrices. But I don’t know what’s wrong. Java int linha = i; int coluna = j; int[][] matriz =…
-
-1
votes1
answer248
viewsParseException error
I have a problem about DATE. This giving error on line 58 about: Exception in thread "main" java.text.Parseexception: Unparseable date: "" at java.text.Dateformat.parse(Dateformat.java:366)…
-
-1
votes2
answers123
viewsChar Search in Object Arraylist
I’m learning java in college and I’m having a hard time developing the logic to search an Arraylist. I want to know if there is a password registered by the type attribute, the passwords were…
-
-1
votes1
answer254
viewsjava.sql.Sqlexception: Column 'id' not found
My code to search in the BD by id. The class is ContatoDao: //Pesquisa por id public Contato pesquisaId(int id) { String sql = "select nome from contatos where id = "+id; Contato contato = null; try…
-
-1
votes2
answers184
viewsHow to access the name and address in the Customer Class, and access description and price in the Java Product Class, being in the Box Class?
I tried to use the following commands: // Requesting the customer’s name name = input.toString(); purchase[i]. getCliente(). setNome(name); // Código do produto a ser comprado, que é o endereço da…
-
-1
votes1
answer40
viewsfill arraylist with arraylist attribute information of another class
I have an Event class with an attribute arraylist<string>lista. I fill this attribute in a Telalista Jframe and use a evento.setLista("informaçao"); to add the textField string to the…
-
-1
votes1
answer286
viewsAXIOS SENDS 2 REQUESTS INSTEAD OF 1
Summary : When I Make Backend Requests with Postman all goes well, but when I make requests with Front-End Reactjs Axios 2 requests come to the API, 1 without Token and the other with Token. I am in…
-
-1
votes1
answer120
viewsDivisors of a number which variable to print
I came across a problem with the splitters of a number and that also goes to other problems I made this code to print me number dividers from largest to smallest, but it is just printing one of the…
javaasked 4 years, 6 months ago Rui Simões 9 -
-1
votes1
answer73
viewsAndroid Studio stopped working after installing Flutter and this error infirmmation
Good morning! I had Android Studio installed on my machine and after installing Flutter it stopped working. I uninstalled Flutter and even then Android Studio does not work and only presents this…
-
-1
votes1
answer40
viewsData conversion using Combobox
Hello, I’m having trouble dealing with an error in my program. I have two combobox inside a registration panel. When executing already appears the list of products and customers, but the code field…
-
-1
votes1
answer113
viewsDelete firebase user from database and authentication
Good afternoon I am trying to do the method that deletes the user from the database and authentication, but it is not working. private void excluirDeslogar(){ final DialogProgress dialogProgress =…
-
-1
votes1
answer176
viewsGenerate standard bar code 2 of 5 interspersed in java
Good morning, I’m trying to implement a barcode generator to generate the payment code for a billet collection type. Researching realized needed to be in pattern 2 of 5 interspersed, the way I did…
-
-1
votes1
answer102
viewsIs it possible to change the color of a jtable cell of type Boolean?
I am trying to change the background color of certain Jtable cells, but when I change the color of a Boolean column it loses the format of a Checkbox and appears written "true" or "false". I want to…
-
-1
votes1
answer166
viewsHow to create an Arraylist with constructor method with String
Hello, I would like to know how I could add these variables within this Arraylist. The program says it is not possible to put String in Publication, I tried casting and did not give. Thanks in…
-
-1
votes1
answer141
viewsHow to create a variable-sized array in Java?
I am trying to perform an exercise in Java that creates an A vector and adds even and odd values in 2 vectors, B and C, respectively. However, I am required to declare the size of these vectors…
-
-1
votes1
answer91
viewsHow to get the result of another method in Java?
How I take the result of method 2 and put together with Resultado.setText of Method 1? 1 public void CalcularIMC(View view) { //recuperar valores digitados String Didade =…
-
-1
votes2
answers45
viewsI cannot capture the message I send in my Exception Java Custom
Everybody, good afternoon, everybody! I need a help, I am creating some java Apis and I created some custom exceptions, when I invoke the type exection I created: throw new…
javaasked 4 years, 4 months ago Joo Pereira de albuquer Junior 1 -
-1
votes1
answer61
viewsSQL code problem in the @Query java annotation
I am trying to perform a command through Inner Join in an annotation @Query in Java, but an error occurs. The code usually works when performing an SQL query without using Inner Join. It follows the…
-
-1
votes1
answer19
viewsPage does not return Managedbean
I’ve seen several similar posts, but it didn’t help much. My problem is very simple. I have a form page that will record data and display in a table using Managedbean. But when I click to write, the…
-
-1
votes1
answer60
viewsGame of Old Doubt
I have the following method: void selecionarBloco() { while (blocoSelecionadoCorretamente == false) { System.out.print("Qual casa você irá marcar (" + jogador +"):"); int blocoSelecionado =…
javaasked 4 years, 3 months ago Davi Ribeiro 27 -
-1
votes1
answer65
viewsHow do I display the names and notes of an array in java?
I’m a beginner in Java and decided to create this exercise to test my knowledge, but I’m breaking my head to show the values of this Array. I want him to show the name of the student at the end of…
javaasked 4 years, 3 months ago Carlos Henrique 31 -
-1
votes2
answers49
viewsJava - Calculating the value of hours for the person responsible for an event
I am building a project (I am a student) in which I need to create an event company. The system shall provide: the amount spent with the responsible; the total cost of lectures; the total amount…
-
-1
votes1
answer54
viewsRandom class doubt in Java
Guys I’m trying to create a system of numbers mega sena. Basically I have to have a client(id) that will generate 6 random numbers. public class Cliente implements Serializable { private static…
-
-1
votes2
answers30
viewsJava programmed calculator code error
The error message is this: it is not possible to find the symbol symbol: gettext method () location: txttela variable of type Jtextfield There are several errors, but it is the same. What I…
javaasked 4 years, 3 months ago antonio ferreira lopes 11 -
-1
votes1
answer88
viewsdownload is not performed via outputStream
I am trying to download a file. CSV that I have saved. However the download does not appear to me when I click the button and no error code appears. How can I test to see how far the procedure is…
-
-1
votes3
answers41
viewsProblems adding multiple elements to Arraylist
I’m practicing java and I’m having trouble printing the results inside Arraylist. Only shows the last typed result. public class ArrayList { public static void main(String[] args) { Scanner teclado…
javaasked 4 years, 2 months ago Carlos Henrique 31 -
-1
votes1
answer26
viewsProblem to request via restTemplate
Hello I am developing a . jar that consults the dollar’s quotation value, through the request for an endpoint provided by the central bank. When I request via Postman json comes correctly, but by…
-
-1
votes1
answer51
viewsExplain to a beginner the query "if(! found)" in the code
I have an exercise that searches a number on a predetermined vector; and answers "was found and which vector position" or answers that "the number is not in the vector". I wanted the explanation of…
-
-1
votes1
answer46
viewsProblem with a Char vector in Java
Good morning! I made a code to read a char that can be a number or a keyboard letter. It’s very simple and running, but I made an integer n for the size of the vector and put the for…
-
-1
votes1
answer33
viewsToken Authentication Micro-service Java
I am separating my authentication service into microservices, but when I separate the token into a module, my authentication service always returns 401 and does not log any This is my config class…
-
-1
votes2
answers70
viewsProblem adding elements to the array
I am trying to add elements inside the Array through a method, but at the end of the execution it repeats the last value inserted. I made a simple code just to show the error and try to avoid this…
javaasked 4 years, 2 months ago Carlos Henrique 31 -
-1
votes1
answer38
viewsIncorrect data output in the list
Hello, the following method is not showing the data output correctly. At the end of the run it shows the name of the product and then the message "CPF not registered". Follows an image to facilitate…
javaasked 4 years, 2 months ago Carlos Henrique 31 -
-1
votes1
answer56
views -
-1
votes1
answer51
viewsData input - Java
At the time of data entry, I realized that when I put the product name and enter, there is always a loose line, the next question does not come on time, only after another enter. However, when I…
-
-1
votes1
answer85
viewsNetbeans Java - Failed to execute Goal org.codehaus.mojo:exec-Maven-plugin:1.5.0:exec (default-cli) on project Sintetizee:
When I try to run my Java file in Netbeans, this error appears Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (default-cli) on project Sintetizee: Command execution failed.:…
-
-1
votes1
answer50
viewsProblem identifying triangle in Java
Well, I’m still much new in the world of programming and I’m trying to make a simple code where it says whether the triangle is isosceles, scalene or equilateral depending on the measurement of the…
javaasked 4 years, 1 month ago Leonardo Vaz 1 -
-1
votes1
answer282
viewsFailed to run Goal org.springframework.boot:spring-boot-Maven-plugin:2.4.3:run (default-cli)
I have the following error in developing an application using the following tools: When running mvn spring-boot:run, it shows the error Failed to execute Goal…
-
-1
votes1
answer26
viewsHelp with method to add new item
Good afternoon I have this sales screen: As you can see I selected a product, set the quantity and the values were set automatically. Now my idea is, to add a new item, with the same fields,…
-
-1
votes1
answer35
viewsProblem climbing springboot application with Tomcat
Good afternoon to all I built a small spring application just for learning purposes and I’m trying to run it with Tomcat, I’ve tried everything and always get error 404. Would someone please explain…
-
-1
votes1
answer58
viewsHow to show Yes and No instead of 0 and 1 in java?
I’m caught in this problem, I need to show Yes and No in the xhtml table instead of 0 and 1, the return type in get and set is Bigdecimal and the shapes I tried always end up breaking or not running…
-
-1
votes1
answer26
viewsBuild error: "Resource Leak" when using Scanner
I cannot compile my code because the following error appears below: Exception in thread "main" java.util.Unknownformatconversionexception: Conversion = '0' at…
-
-1
votes2
answers40
viewsManual String Breaking in JAVA
Gentlemen, I am trying to do a routine that receives a certain text and a word from the user, after checking if within the text there is a word equal to what was requested. My attempt was to…
java comparison string-concatenation characters jtextareaasked 4 years, 1 month ago Gabriel Galdino 3 -
-1
votes0
answers18
viewsjavac -classpath . (Debian 10 Buster)
I’m using the Geany to do so. However, I was unable to compile the simple Hello World!. With some researches I found two reference links, being them: https://www.guj.com.br/t/ola-mundo/51431/13…
-
-1
votes1
answer36
viewsHow to get the x and y coordinates in a circle from an angle
I’m trying to create an analog clock and my idea was the following one would get the angle corresponding to the hour and then discover the position x e y of that angle in a circle and draw a line…
-
-1
votes1
answer16
viewsOracle database data in combo box
In a Java project, I am using Hibernete, and Java Sprint Boot, the combo box was created in the registration screen, where the registration of a person is made, where a combo box is presented, with…
-
-1
votes1
answer42
viewsHow to fill null spaces in a java array?
I need to store a person’s first and last name within a variable. I was able to separate String words within an array and take the first name (by index 0) - and now I would like to know how to get…
-
-1
votes1
answer46
viewsLogical operators with different value
nome_adc_1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { double percent = (estimatedFare*0.20); double soma = estimatedFare + percent; double subtrai =…
-
-1
votes2
answers32
viewsI cannot update my object using PUT
Although I know very little about Spring because I am learning, I cannot save a recovered object, the error is when I pass the object personal Pository.save(personSalva) I came to see some examples,…