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
-
-2
votes1
answer569
viewsHow to pass an Angularjs value to the JAVA controller
I have a form that sends a value (CPF) of a page to be checked for existence in the database. Use an angular controller to send Cpf to service and then to Java(controller). I’d have some example of…
-
-2
votes1
answer62
viewsI’m having doubts about how to access an instantiated object in another class
How can I print the ve.nome raised in the class TesteClientesPedidos, by means of the method mostrarDadosVendedor() of the Seller class? Class Testerscustomers: public class TesteClientesPedidos{…
javaasked 7 years, 5 months ago Diogo Lopes 35 -
-2
votes3
answers575
viewsEPSON non fiscal thermal printer does not work in a shared way with USB and LPT
I am creating a system in PHP and we are entering the printing phase with non tax thermal printers. In principle I did not find Epson support for PHP printing and in researches I found the component…
-
-2
votes1
answer394
viewsJDBC Mysql Related Eclipse Error
I am trying to connect the mysql database from my JAVA application. But I get this message: org.apache.Jasper.Jasperexception: An Exception occurred Processing JSP page /index.jsp at line 31 28:…
-
-2
votes1
answer54
viewsWhat’s the bug in the program?
Give me one mistake R appears in red. public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
-2
votes1
answer109
viewsWhy does the program close when I click the button?
Could someone tell me why the program closes after clicking the button? import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import…
-
-2
votes1
answer71
viewsVector exercise, do I need help?
Question: Read two vectors: R of 5 elements and S of 10 elements. Generate a vector X of 15 elements having 5 first positions containing the elements of R and the last 10 positions, elements of S.…
javaasked 7 years, 5 months ago Julio Souza 1 -
-2
votes1
answer42
viewsNot deleting from the Database the data I want
I have this code that supposedly erases the date I put in the method from Database. But it’s not deleting from Database and I don’t understand why. Here is the information : public void…
-
-2
votes1
answer52
viewsAdd and display Indtent in another class
Good wondered, how can I add this (Intent) and how to print it at the end of the program in another Class. public class Main2Activity extends AppCompatActivity implements View.OnClickListener{ int…
-
-2
votes2
answers4075
viewsJava - method to check whether a String contains a certain character
I have a problem with this method. It seems to me, whenever I try to use it with some String, I get false for the value of a, even if the string contains these three characters. Someone can tell me…
javaasked 7 years, 3 months ago Eduardo Brito 59 -
-2
votes1
answer1122
views"String index out of range: 5"
There is an error mentioned in the question in my java program. The program is a barcode reader. The user informs the digits of the code (except the last one). The sum of the numbers q are in odd…
-
-2
votes1
answer3158
viewsHow to do Cifra de cesar
When colo (ABCDE) with displacement 5 he encrypts (FGHIJ), when actually it should be (EFGHI). I’ve tried everything I can not solve. In case he’s making the next shift to my input. package…
javaasked 7 years, 2 months ago Murilo Neto 1 -
-2
votes3
answers536
viewsInstanceof with List in JAVA
I have declared a method that receives a List of the kind Object. But when I try to recognize him as instanceof it gives error. I have tried to do a casting but still giving error and could not…
-
-2
votes1
answer41
viewserror : while expected /eached end of file while Parsing
Guys I’m having problems with my Bingo app public class MainActivity extends AppCompatActivity { int[] ids = {R.id.button2, R.id.button3, R.id.button4, R.id.button5, R.id.button6, R.id.button7,…
-
-2
votes1
answer774
viewsFirst name, Last name, JAVA POO age
I have to do this: Computationally model the problem of getting the full name, age, the age in months from the name, surname and year of birth of a person. I did so but it’s not working, someone can…
-
-2
votes1
answer282
viewsUnsupportedclassversionerror when trying to generate a jar
I compiled my code and everything and when I will open the file .jar valet says A JNI error has occured cmd: C:\Projetos\Java\Projetos\Projeto02>java -jar Gerar.jar Error: A JNI error has…
-
-2
votes1
answer73
viewsRepetition of Numbers
Good staff I have the following situation: I have an on-screen account like this: x + 1 = 2, the user has to click on the option that completes the account and I tried to use this code of my…
-
-2
votes1
answer105
viewsI cannot perform the indicated operations
Prepare a program that, given 2 integer vectors of 20 positions, performs the respective operations indicated by a third vector of characters of 20 positions also provided by the user, containing…
-
-2
votes2
answers347
viewsJava Language - Undo and Redo functions
I’m doing a project where I develop functions to apply effects to photos (such as Contrast, Vignette, Sepia...). As I apply effects to photos, the various states of the photos are being stored in an…
-
-2
votes1
answer61
viewsHow to create a combo with 2 values?
I am completely lost, I am trying to create a combo box, where I can display "a value/text", more, that when giving a getValue on it, I can get another value. For example, I wanted to display, "Item…
javaasked 6 years, 8 months ago AlunoOracle 183 -
-2
votes2
answers773
viewsusing java class from another directory
Well friends, I was using two classes: Funcionario.java (Class 1, from the directory /home/lcs/Documentos/java/exercicio3) and UtilizandoFuncionario.java (Class 2, from the directory…
-
-2
votes1
answer199
viewsJava parce csv to my bean - Opencsv
<!-- https://mvnrepository.com/artifact/com.opencsv/opencsv --> <dependency> <groupId>com.opencsv</groupId> <artifactId>opencsv</artifactId>…
javaasked 6 years, 8 months ago Gustavo Enndi 1 -
-2
votes1
answer27
viewsHow to insert a value in a table copy?
I’m performing a table transfer "Histo_Ficha_Controle" for "Cad_Espec_Teste". The two tables contain the same fields to receive the information. When copying from one table to another, I would like…
-
-2
votes1
answer1331
viewsSpoon.bat does not work with windows 7 and java 1.8
After unzipping the Pentaho PDI. I try to run Spoon.bat and get this message below and do not open the IDE I’m using java 1.8 and windows 7 64bit Error message: DEBUG: Using JAVA_HOME DEBUG:…
-
-2
votes1
answer484
viewsHow to enter data (registration) in Sqlite?
Hello, my Sqlite connection is as follows: Connection connection = null; try { // create a database connection connection = DriverManager.getConnection("jdbc:sqlite:database.db"); Statement…
-
-2
votes1
answer832
viewsDouble.valueOf(String). doubleValue()
Since I could not convert a String to Double, because it is decimal, I used Double.valueOf(String). doubleValue(). But when converting a String to Double with "." the numbers above 3 houses (1,000)…
-
-2
votes1
answer23
viewsWrong code error in setType " non-static method setType(String) "
android.support.design.widget.FloatingActionButton android:id="@+id/floatingActionButton" android:layout_width="wrap_content" android:layout_height="wrap_content"…
-
-2
votes1
answer702
viewsRead latest email - Javamail
I gave a search here but unsuccessfully. Someone knows how to find the latest email using the JavaMail? What I’m using pulls all the emails. My code: try { campolog.setContentType("text/html");…
javaasked 6 years, 4 months ago Abner Rodrigues 23 -
-2
votes1
answer329
viewsGet into Webclient by passing json as parameter
I’m doing the requisition this way, but I’m not succeeding , someone who’s been through it? private static String vwsApiUrl = "http://vws.veloxtickets.com:82/wscinema.ws/Get_Cinema_Programacao";…
-
-2
votes1
answer1001
viewsError "Setting Property 'source' to 'org.eclipse.jst.jee.server' Did not find a matching Property"
I need help to solve the problems that appear in the log record: Setting Property 'source' to 'org.eclipse.jst.jee.server:Apasispringmvc' Did not find a matching Property. Full log: jul 20, 2018…
-
-2
votes1
answer90
viewsCNPJ Mask Problem in print in database (solved)
This is the class that validates the CNPJ: package br.com.Sistema.meuProjeto; import java.util.InputMismatchException; public class ValidaCNPJ { public static boolean isCNPJ(String cnpjFornec) { //…
-
-2
votes1
answer212
viewsError executing code in netbeans (JAVAFX)
The error is as follows (remembering that only happens in javafx, in swing everything works normal): Exception in Application start method java.lang.reflect.InvocationTargetException at…
-
-2
votes4
answers940
viewsJava: How do I store a vector in another vector and using Math library
my doubt is the following, I have to read 20 integer numbers in one vector and then I have to compute the square of that vector and store in another and then display the two. But when it comes to…
-
-2
votes1
answer513
viewsGRAVE: Allocate Exception for Servlet
I’m afraid of this mistake! I’m using Tomcat 8.5 Code package br.com.controler; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest;…
-
-2
votes3
answers114
views -
-2
votes1
answer247
viewsReturn treated message when it occurs (with.mysql.jdbc.exceptions.jdbc4.Mysqlintegrityconstraintviolationexception:)
Can anyone help me return a message dealt with when it occurs com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExcept ion: Cannot delete or update a parent row: a foreign key…
-
-2
votes1
answer916
viewsJava get and set methods for Boolean and char
I’m developing a code that uses get and set methods for data entry and processing. The goal is input with 9 values each with a data type, but I’m not getting the conversions for the char type and…
-
-2
votes1
answer658
viewsHow to mock a private function in Junit
I have a main class Usuario extending (extends) an abstract class called Sessao, and uses a function of Sessao calling for obterDados() that takes session data and returns to an object SessaoTO. I…
-
-2
votes3
answers491
viewsConverting C to Java
Consider a method that takes 2 parameters and makes a calculation to generate a check digit. Follow the code snippet I’m having difficulty: char metodoDigito(char num, char qtos) { short soma, peso,…
-
-2
votes1
answer58
viewsError javax.el.Propertynotfoundexception: Array index out of range: 0 Java JSF intersection exercise
I’m new to programming and new to the Forum. I have a college exercise that I’m not able to do, I need to create a screen called Intersection, which takes 2 intervals and returns a message on screen…
-
-2
votes1
answer45
viewsHow do I display attributes of an object stored in an array?
I’m doing a job that consists of fictitious real estate. In this program there is a class called principal where it receives Immovel (Class) and stores the immovables in a vector, a class…
-
-2
votes1
answer71
viewsData comparison after nextLine java
I’m unable to make my verification structure work, I can’t after typing stop, display the message and the program continue the loop. /* * To change this License header, Choose License Headers in…
javaasked 6 years, 1 month ago Deny Programador PHP 53 -
-2
votes1
answer237
viewsHow could I generate an xml in java?
Similar to this one here, in this format. This code will be generated through a button event. <items><variable name="id"type="int">6</variable> <itens><variable…
-
-2
votes1
answer134
viewsInsert with select if the field is null
I have today this INSERT in JAVA running but I need to implement a new routine: public void gravarLogAbonoUnificado(TbLogAbonClickUnic entity, RetornoAuxDto auxDto) { STRING SQL = "INSERT INTO" +…
-
-2
votes2
answers1589
viewsHow to pass CSV file data to an array in Java?
I have a. CSV file with several numbers in two columns (1032,54832). I need to take these numbers and pass them to an array. How do I do this? I made a code to import the file and I can display the…
-
-2
votes1
answer48
viewsIllegalstateexception
Good afternoon, I have a simple web application (JSP / Servlets), which when starting on Tomcat 8.5.16, does not "run" and sends the following message on Catalina.out: INFO [Abandoned connection…
-
-2
votes1
answer103
viewsInsert Problem: String sql is correct, but does not insert by Java, only manually by Mysql! Procedures attributes date time
Good evening guys! I’m using java and Mysql. At the moment I’m using Procedure for insertion everything happens perfectly the String goes to the bank with all the correct parameters, but something…
-
-2
votes1
answer49
viewsHow to implement the DAO standard in subclasses?
I’m developing an app that’s a gun store. I own the class Produto with the subclasses Arma, Faca and Municao. In this project I am applying the DAO standard, but I don’t understand very well how its…
-
-2
votes1
answer73
viewsQuestions with JSF
Well, I am not long in Java WEB and I have some doubts in Javaserv Faces, and I would like to understand, to be able to manipulate well, etc. So if anyone can ask my questions, I would be grateful.…
-
-2
votes1
answer188
viewsCan’t Convert error Object of type
This one started to appear out of nowhere, apparently I didn’t change anything in the code and simply by making changes in other parts it appeared. Error: 12-07 07:47:43.652…