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
-
-5
votes1
answer71
viewsI can’t get the variable value from different classes
my colleagues good night I help myself here , I am doing a job for college , I am beginner in Java , I can not pass I have 2 class 1 -patient 2 doctor, the medical class is already with patient…
javaasked 7 years ago Gilliard Pacheco 11 -
-5
votes1
answer48
viewsMy code only takes the last element of the database
My code only takes the last element of the database, but it lists the correct amount there and the log.i shows that is catching all. Why it does not work? package br.app.lista; import…
-
-5
votes2
answers134
viewsMake a program that calculates the value of H*S, being:
I was using this solution based on a code from a friend: but we are uncertain about the outcome. double h = 0; double n = 4; double s = 0; double n1 = 36; for (int i = 1; i <=n; i++) { h = h +…
javaasked 3 years, 8 months ago play that funky music 1 -
-5
votes2
answers97
viewsMy calculator from the while in position 2, skips the insertion of the first value someone can help me?
package Calculadora; import java.util.InputMismatchException; import java.util.Scanner; public class calculadora { public static void main(String[] args) { float valor1 = 0; float valor2 = 0; float…
javaasked 3 years, 6 months ago Eleodorio Rodrigues 1 -
-5
votes2
answers55
viewsHow to format the date and month so that they are typed 0 in their formatting (day or month that goes from 1 to 9)?
I’m wanting to add a zero in the day and month in the date that the editData_devolucao receive. Like, instead of appearing day 05 is just 5 and in the month instead of appearing 06 appears only 6.…
-
-5
votes0
answers16
viewsSelect only returns last Sqlite database record
I don’t have much programming experience and I’m having trouble with a BD query. It’s only returning the last data entered. I need to list all records entered in this table. @Override public void…
-
-6
votes1
answer62
viewsHow to view files. zip using java for android
I wonder how I do a program that can view . zip files on android using java, I’ve been looking for a while and did not find ;(... If possible in the easiest way, if there is one... Thank you!…
-
-6
votes1
answer126
viewsError in IMC code
I have the code below, which calculates BMI, you can tell me his mistake? Follows the code: import java.util.Scanner; public class Paciente { public static double calcularIMC(double P,double A){…
javaasked 8 years, 5 months ago Paulo Buchsenspaner 11 -
-6
votes2
answers1061
viewsConvert dd-mm-yy date to yyyy-mm-dd in Java
I am receiving via form: 28-set-2018 and I need to save in the bank 2019-09-29 00:00:00
-
-7
votes1
answer22
viewsDatabase in CSV
If everyone while creating applications on the WEB ,Desktop or Mobile needs to export or import data type csv because they have not created a DATABASE MANAGER SYSTEM in csv ? Answer: Is there…
-
-7
votes1
answer210
viewsHow to print a list with the result of all numbers in a sequence summed with itself? (sequence)
I have this sequence of numbers: 1,2,3. (Can be from 1 to infinity.) I want to add every number in the sequence to it all, example: The sequence has 3 numbers. You have to add in this way: (1) 1+1=2…
javaasked 7 years, 5 months ago Felipe Cortez 21 -
-7
votes1
answer413
viewsHow do you reverse the variables?
Write a program in Java with what is requested below. A - Declare the variables X, Y and Z of type int. B - Assign 10 to variable X. C - Assign 2 to variable Y. D - With the help of the variable Z…
javaasked 6 years, 5 months ago igor silva 1 -
-7
votes1
answer171
viewsPrint all cards in the deck (Java)
Hello. I am trying to create a program that prints all 52 cards in the deck, from 1 to 10 and with all suits (Clubs, Diamonds, Hearts, Spades) and also print the cards Jack, Queen and King. I found…
javaasked 6 years, 1 month ago César Augusto 11 -
-7
votes1
answer190
viewsHow to exclude a parent entity without excluding the daughter entities?
How do I, by Annotations or methods to delete, or effect a update in a parent entity without being obliged to exclude the daughter entity, ex: public class Produto{ @Id @GeneratedValue int id; //...…
-
-8
votes1
answer591
viewshow to compile java application and generate your Bytecodes
I can’t compile my application from the prompt (cmd). Whenever I try, it gives some error. I think I’m doing it wrong because otherwise it would have worked.
-
-8
votes1
answer234
viewsWhat does this program do in Java?
I received the program in Java from the link below and I would like to know what it does. I’m not getting it. The code is in this: http://pastebin.com/mT3rHWP0 Sorry for not attaching the code here,…
javaasked 8 years, 1 month ago Evandro Ferreira 25 -
-8
votes1
answer263
viewsWhy doesn’t the printf concatenate?
I’m an innovator in Java and I’m in trouble because printf does not concatenate two quantiles with a variable, since the println let me work with decimals but it doesn’t work with them. See: if…
javaasked 7 years ago Gilliard Pacheco 11 -
-9
votes1
answer127
viewsWhat are types in the return of a method?
I used PHP and I’ve never seen it, we know there are types of return double, float, int, boolean. In Java when we want to return one int I’ll tell you what: public int soma(int numero1,int numero2)…