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
-
0
votes1
answer633
viewsJPA insert an object that has a list as attribute
I am developing a layered system(packages),to exercise the concepts of class and came across a question I would like to create a product class,the same has attributes that are references of other…
-
0
votes1
answer45
viewsCycle for only runs once inside a while and should always be run
listaA = new ArrayList <>(); boolean n = true; while (listaA.size() < listab.size()) { Log.i( "while ordena" , String.valueOf( listaA.size() )); valorAl = nRandom.nextInt( listab.size() );…
-
0
votes1
answer79
viewsJava, when I use CRTL+V, does the question mark appear in front of the text?
I made a class that will fetch a text in a file .TXT which is saved in UTF-8 format, and record in Clipboard for me to paste with CRTL+V in a field of another system. The problem is that when I use…
-
0
votes0
answers80
viewsHow to run JADE (Java Agent Development Framework) on linux?
How to Rotate JADE (Java Agent Development Framework), is a framework for SMA, in the latest version of Lubuntu ? I am using Lubuntu 32bits - 17.10.1. I’m having a problem running it on Ubuntu (the…
-
0
votes1
answer95
viewsJPA Error when inserting a product object that has reference to an existing object
I am doubtful in the note manytomany ,I know that it serves to indicate to white that he needs to create an intermediate table and that in turn is located on top of an element that will be list…
-
0
votes1
answer416
viewsError with.fasterxml.Jackson.databind.Jsonmappingexception
Error shown: 04-25 14:01:32.589: I/Recebendo pela rede(31129):…
-
0
votes0
answers216
viewsJava - Generic Type as parameter of the readEntity method of Jax rs client
I want to abstract a post method from my code, using Generic type to facilitate implementation. The code is a Ws client using Jax-rs. The following public T2 post(T1 requisicao, String path){…
-
0
votes0
answers88
viewsSimpleadapter (JSON with sub-items)
I’m new to Android development, and I’m trying for days to make my first app work but without success. I am using Asynctask to make the request and Simpleadapter, it back the data but my JSON has…
-
0
votes0
answers146
viewsHow to recursively remove nodes in a binary tree?
I cannot understand and encode the working of the node removal method in a binary tree. Note: Add and Print (RED) methods have already been implemented. package trees; public class binaryTree { Node…
javaasked 6 years, 5 months ago Matheus Lopes Barbosa 1 -
0
votes1
answer1389
viewsRecover Data from Firebase in Recyclerview
I need to recover from Firebase in Recyclerview user order requests in a way that organizes these requests in a list without overwriting the other one. For now my list is static. Each user has an id…
-
0
votes3
answers5118
viewsJava Tabulated Calculation, using Repeat Loops
I’m having trouble solving the following exercise: Display the tabulated results of any number. The user informs what value he wants. The tabulation should be performed from 0 to 10, using the loop…
-
0
votes1
answer826
viewsError deserialize JSON - How to Resolve?
I’m using jpa and I have these two entities: @Entity @JsonIdentityInfo( generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") public class Categoria implements Serializable { @Id…
-
0
votes0
answers198
viewsAndroid Mysql Connection - Error with POST Method
Good night! I am developing a simple interface in Android Studio to login and register users. I followed the steps of a tutorial on youtube and almost everything works perfectly, I’m just having…
-
0
votes1
answer38
viewsDoubt regarding Join with multiple tables
I have a sale class and the same receives several products(manyToOne) and customer (oneToMany) and would like to join all in a Join to make a report with only the desired information. I tried to…
-
0
votes1
answer109
viewsExchange of information between Recycleviews
I have request tabs where "RECEIVED" retrieves data from Firebase BD inside a Recycleview. Request made by a user and received by the company. Now how do the items below: 1 - The company…
-
0
votes2
answers218
viewsApp hangs after ending loop in Thread
Hello, I made an app in Android Studio that breaks the phrases in words and stores in an array using split. Then I made a loop of repetition using while so that it displays word for word, but there…
-
0
votes1
answer51
viewsTerminal values for a program
I am facing the following problem by running the following commands on the terminal, java -jar logisim-filename.jar adder-test.circ -tty table i get a table on the terminal itself, delimited by…
-
0
votes2
answers856
viewsHow to use p:fileDownload to download a specific file
I have a datatable and I want to implement a download button to download the pdf file from that specific line. I already managed to implement p:fileUpload and now I want to download this uploaded…
-
0
votes1
answer77
viewsWhat am I doing wrong? Java exceptions
Main (Testeexceptions.java:14): Conta c1 = new ContaCorrente(444, 444); c1.setSaldo(5000); Conta c2 = new ContaCorrente(444, 445); c2.setSaldo(353); System.out.println(c1.getSaldo() + "\n" +…
javaasked 6 years, 5 months ago João Raphael 65 -
0
votes1
answer63
viewsAsynctask Android generating Nullpointerexception
I have this static class in an Activity where its function is to download a file and save it on the user’s device. I tested on a real device in the version of Android 7.1.1 and 4.1.2 and worked…
-
0
votes1
answer1397
viewsProgram that reads real number in Java
I’m having a rather idiotic doubt let’s say so, but I’m not remembering what I have to do to make it right. I must create a program that reads an entire number and prints on the screen. Here’s what…
-
0
votes1
answer1579
viewsImport github project into STS (Spring)
I’m having a hard time importing a spring project from github, and I can successfully import the project when it’s eclipse Oxygen from the java perspective (Desktop). Procedure used for importing :…
-
0
votes1
answer83
views"<p:message" Does Not Display Message in XHTML
Hello, I am implementing a register using the primefaces to present the critical messages performed in the bean. I’m using the Facescontext as below:…
-
0
votes2
answers465
viewsHow to prevent the object to exceed the limits of the screen?
I started programming a little game where an object moves across the screen via the arrow keys on the keyboard. The difficulty I found is the fact that the object surpasses the JFrame, that is,…
-
0
votes1
answer318
viewsRecycleview item returning the same data for all items when clicked
I have a list of addresses in Recycleview and each address has its latitude and longitude coordinates retrieved from the bank. But when I click on the list item to start a route from the coordinates…
-
0
votes1
answer208
viewsJPA+HIBERNATE error
Sirs. I have a class called User. @Entity @Table(name = "tb_usuario") public class Usuario { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @Column(name = "email", nullable…
-
0
votes2
answers319
viewsError: Exception in thread "main" java.lang.Nullpointerexception at pub.Pub.main(Pub.java:18)
I’m developing a program in java, I’ve looked at several places to know what I’m missing, all said that my variables are receiving null value, but I’ve tried to instantiate values in it, use…
-
0
votes1
answer87
viewsRead an Even number
I am again in doubt, now the doubt is related to exercise on Desvio de condicional Simples using only the command IF After reading an integer value, calculate and display its square only if the read…
-
0
votes1
answer672
viewsChange the color of the Jtable header
How do I change the header color JTable using the Nimbus Look And Fell? I tried to use: JTableHeader header = jTable2.getTableHeader(); header.setBackground(java.awt.Color.yellow); But it didn’t…
-
0
votes1
answer200
viewsHow to use Files.move with Java?
I have created a photo upload on my system, these photos are saved in a temp , I need to move them to a default directory, other than temp. This is the method that creates the directory : public…
-
0
votes0
answers22
viewsError when trying to implement Abstract data type class
I need to implement a TAD in repl.it, but gives the following error: Error: Could not find or load main class Main Exit status 1 import java.lang.Math; class Ponto { public int x; public int y;…
-
0
votes0
answers49
viewsp:summaryRow does not work with p:Columns
I have a JSF page with a p:columns to show data analytically and a p:summaryRow to display the summary. Turns out inside of mine p:summaryRow, I have a p:columns, because I can’t predict how many…
-
0
votes0
answers100
viewsDoes not take elements with Selenium in Chrome
I’m trying to get elements from a page but it’s not found. Follow the code of the page: <form method="POST" action="j_security_check" onsubmit="return(OnLoginSubmit());"> <input…
-
0
votes1
answer423
viewsTomcat - RFC 7230 and RFC 3986
I’m having a problem : Error Parsing HTTP request header My apache server Tomcat 8 is rejecting the requests for a system which I did an integration, the error is due to characters that are in the…
-
0
votes0
answers42
viewsPass gridView values to edit Activity
Please, whoever can help me I’m very grateful I’m having trouble passing the value of radioGroupOps for editing screen. // Abre a tela de cadastro/edição com os registros para edição.…
-
0
votes1
answer133
viewsCatch record with JDBC SQL specification
Hello, good afternoon, sir. I’m having to develop a Java system with Mysql. It’s simple, just the part of the backend, but I’m inciante and had not run querys with java before hehe. The system is…
-
0
votes1
answer1184
viewsPLSQL resume error while retrieving data from Database
I try to extract data from the database and insert it into a record and then show it in the cmd, But when I get a higher registration number the procedure requires an error message. Code: SET…
-
0
votes1
answer156
viewsHow to create a Registry vector in PLSQL
I have a record of TYPE trec IS RECORD ( cd_multi_empresa NUMBER(8,2), tp_atendimento CHAR(2) ); vcAtendimento trec; I need a registry vector, I used this and command: TYPE TcAtendimento IS…
-
0
votes1
answer33
viewsRead Two Notes and Make Media If They Are Valid Notes
I’m having trouble solving the exercise below Shall I wear Desvio Condicional And by my "thoughts" I believe I should use the Desvio Encadeado I know that both grades must meet the criteria of…
-
0
votes0
answers28
viewsI am trying to update a database field, by Adapter. How do I do?
... public void concluirAtividade(Atividade atividade){ ContentValues contentValues = new ContentValues(); contentValues.put("SITUACAO", atividade.situacao); String[] parametros = new String[1];…
-
0
votes0
answers167
viewsHow to implement a queue TAD with complex objects?
I need to implement a data structure queue, with objects, being RA and student name but I’m not able to evolve, a queue with only integers I get good, already this will not even. I think I’m getting…
-
0
votes2
answers305
viewsSave data to an Activity when changing Activity
The program is a counter, by clicking the button + it adds +1 to the variable counts1...cont2..., I want when I click on the report and I return to this page, the data I added the variable to be…
-
0
votes1
answer392
viewsChecking the existence of an object in an arraylist
I have a class PessoaFisica and a class PessoaJuridica, both inherit from the class Cliente, whose attribute to identify is the code. I am creating a method to check if the element already exists in…
-
0
votes1
answer98
viewsRemoval of Duplicate Elements : divide and Conquer
I’m having trouble getting an algorithm that removes duplicate elements in an array (can only be integers), which uses the method Divide And Conquer. I am in need for a college job, and…
-
0
votes0
answers244
viewsJava build error (Eclipse) using Scanner class, beginner problem
I’m starting to study Java now for the book "Java How to Program 10 Edª" and I’m having trouble compiling this book code in Eclipse ( Follow the Error Image ). Follow the code below Could someone…
-
0
votes1
answer605
viewsHow to query select and call the connection from within
I need help for my dao structure, as I call the connection, how I select within the function and how I list in my main the information coming from select. As it is so far: Connection to the bank.…
-
0
votes0
answers101
viewsSave data when changing Fragment
I want to save the values that are on the counter for when I change from Fragment and go back to that, the values that I counted are there. I tried to use Savedinstance so that it did not work,not…
-
0
votes1
answer138
viewsReactive Database Connection
I am developing an app with Spring Boot and I have a configuration class that generates a @Bean Datasource. I would like to generate alternative connection levels of connection to the database, as…
-
0
votes1
answer268
viewsError using Jplay framework for games!
Hello, I am trying to program in java with the Jplay framework, and I am finding an error that was non-existent on another pc that I had. The error step is found in this video lesson:…
-
0
votes2
answers1029
viewsHow to delete directory from internal storage on Android?
I have two functions to save files in the internal memory of my application, one for data in Json and the other for Images. With each new app update, I will need to remove these directories so that…