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
-
-4
votes1
answer94
viewsJava List Algorithm - Remove music from playlist
I need to create a java playlist algorithm that removes music from a playlist, I already have the forward, back, random and play buttons; I need to remove music from the playlist with a playlist…
-
-4
votes1
answer119
viewsStructure of Java projects
I’m having doubts where I work, there are many projects with many different classes, and they use patterns that I didn’t learn in college. Patterns like: DTO, Canonico, Entity. Within these…
-
-4
votes1
answer147
viewsIs there a function that does the same thing as "fetch" in java?
I need to make a request at an api url, but how would I do that in java? I’ve researched such a "getch" but I don’t know if it would work, what can I do to make this request in java ?
javaasked 5 years, 5 months ago Guilherme Coronado 3 -
-4
votes2
answers259
viewsGet the position in a for loop in java?
My java code: for (Construtor usuario: users){ Construtor USER = new Construtor(user.getNomeUsuario); arrayList.add(USER); } ** How do I get the position of the loop in this configuration above? See…
-
-4
votes1
answer73
viewsJava array with alphanumeric indices
Merry Christmas to all! How do I, in java, that array? { "Aluno" => "fulano", "Idade" => 33 } I thought about Arraylist, but it didn’t work out I thought about List, also did not work Think…
javaasked 4 years, 11 months ago Carlos Rocha 1 -
-4
votes1
answer28
viewsError: cannot be resolved
On line 14 is giving errors "keyboard cannot be resolved", seeing print someone knows tell me the pq ?…
javaasked 4 years, 7 months ago diego.sfc100 1 -
-4
votes3
answers66
viewsCan someone explain to me what this program does?
public class Break { public static void main(String[] args) { long i = System.currentTimeMillis(); for(int count=1 ; count <=1000000 ; count++){ if((count % 17…
javaasked 4 years, 3 months ago Marcelo Carvalho 13 -
-4
votes1
answer35
viewsType a value with "." dot. Ex: 7.5
Good evening, I started using JAVA a little while ago, I wanted to know how to make the user can type the value with "." point. In case anyone can help, I’d appreciate it!! import java.io.Console;…
-
-4
votes1
answer144
viewsIs the conditional structure "if Else" more performative than a "switch case"?
There are major differences in performance between the conditional structure if else and the switch case within a program?
-
-4
votes1
answer35
viewsINTELLIJ + JAVA PROBLEM
Good evening before everything I want to say that I’m a complete beginner and I’m taking a Java course at Udemy and when I’m creating a class the class name is highlighted red and can’t "interact"…
-
-4
votes1
answer45
viewsTransform a simply chained list code into a dual chained java list
I would like you to help me because I am not yet very familiar with double-chained lists.
-
-4
votes0
answers19
viewsError when adding Big Decimal elements
I need to add all pre-defined elements to the elements that will be inserted by the user, but gives error when instantiating Bigdecimal private BigDecimal concentracaoK; private BigDecimal…
-
-4
votes1
answer102
viewsSQL tags in query
I am starting my studies in SQL and do not know what meaning of this structure below. I would like to know what are these tags. I am using in Java. I have a file mapper.xml to create queries in…
-
-4
votes1
answer339
viewsHow do I compare a character in the range of an alphabet?
The question is this:: 1)Help the university set up the divisions of the programming laboratory. For this, write an algorithm that reads the student’s name and tells which division he is respecting…
-
-4
votes1
answer70
viewsAdd one more check, how to proceed?
I would like to know how to add 1 more check. I would like to have row 31 checked as well. Example: Object obj2 = modelo.getValueAt(linha, 31); In this code here. else if…
-
-4
votes1
answer165
viewsI’m trying to apply object orientation to a Java program
I’m trying to apply object orientation to this program and I wanted to start with the exchange of these ifs, does anyone have any hint of what to put in place? import java.util.*; public class…
-
-4
votes1
answer61
viewsWhat’s wrong with it?
import java.util.Scanner; public class desafio { public static void main(String args[]) { char op; float soma; float mult; float sub; float div; float…
javaasked 7 years, 1 month ago Lucas Aranha 11 -
-4
votes1
answer72
viewsWhat’s the mistake in that code?
I did not understand what the error of the code. import java.util.Scanner; public class Questao4 { public static void main (String[] args){ Scanner scanner = new Scanner(System.in); double Altura,…
-
-4
votes1
answer81
viewsError with constructor
MyCircle c = new MyCircle(2,5,8);/// Instanciei um objeto no main. public class MyCircle { private MyPoint center; private int radius=1; public MyCircle(int x,int y,int radius) {…
-
-4
votes1
answer62
viewsDbsqlite Android Studio Problem
Good afternoon, I have syntax problem in my Sqlite code in Android Studio. Could someone help me? package.com.projetofinal; import android.content.Context; import android.database.Cursor; import…
-
-4
votes1
answer146
viewsJava game using Random,Boolean,Scanner,while,if/Else
The idea of the game is to use a Random from 1 to 100 and the user to hit, when the number of the user is higher, send a message warning the user, in the same way if it is smaller and giving more…
javaasked 6 years, 5 months ago Dennys Kaluzny 1 -
-4
votes1
answer152
viewsScreen gets disorganized when running
I’m having a problem, I’m starting on android programming! I had already started a while ago and stopped for the same reason I’m having now: my computer is not very good and kind that does not…
-
-4
votes1
answer73
viewsjava.lang.Noclassdeffounderror - Trataerroclass
I’m trying to climb an application made here at work and every time I try to run on tomcat this error. I have already done a search and apparently says that the class is using another class that is…
javaasked 6 years, 1 month ago Vinicius_pascucci 1 -
-4
votes1
answer35
viewsError Passing Object To Other
Eai personal. I am new in java and an error is happening where I want to pass an object from one class to another object from another class and keeps giving the following error. incompatible types :…
javaasked 6 years, 1 month ago Igor Vargas Paes 5 -
-4
votes1
answer187
viewsI need help with a method
I have a problem related to a game that I’m creating where the character drops a bomb in the position that he is in. In the first execution of the method bomba() execution goes as ordered. However,…
-
-4
votes2
answers112
viewsWill someone please explain to me how I get to this algorithm?
public class Binary { public static void main(String[] args) { // Print binary representation of n. int n = Integer.parseInt(args[0]); int power = 1; while (power <= n/2) power *= 2; // Now power…
-
-4
votes1
answer603
viewsHow to apply unit test when the main class is an interface?
I have this method in my Beginning class @Override public void question() { String question = String.format(TEXT_OF_A_QUESTION, this.namePlate); int answer = JOptionPane.showConfirmDialog(null,…
-
-4
votes1
answer226
viewsJava methods?
I’m developing this simple scheduling algorithm but the methods listar() and buscar() are not working, I choose and is simply ignored. package strings; import java.util.Scanner; public class Agenda…
-
-4
votes1
answer86
views -
-4
votes1
answer72
viewsHow to pass the array from a method to Another method using interface
I want to create a program that uses interfaces to create a vector class with name and size and have the methods below: <> +Definirnometamanhovetor +PreencherVetorCriadoInformandoPosicaoValor…
-
-4
votes1
answer31
viewsproblem with if and Else
i was in the middle of a java class and my eclipse ide just doesn’t recognize any, IF I’ve been trying for a long time to solve someone help me code: package projeto_leitura; import…
-
-4
votes0
answers23
viewsError 404 with Servlet
I am having a 404 error on my login page. I’m very beginner and so it’s probably a stupid question. Maybe my mistake is on the way, but I can’t find it. The. jsp reference is login.jsp that you…
javaasked 3 years, 3 months ago Vitória Natália 1 -
-5
votes1
answer377
viewsError - Nullpointerexception
03-20 10:35:20.250: I/Process(897): Sending signal. PID: 897 SIG: 9 03-20 10:35:25.870: E/SQLiteLog(914): (1) no such column: name 03-20 10:35:25.870: E/data(914): Error while searching contacts:…
-
-5
votes1
answer103
viewsNullpointerexception on android in project to download Pdfs
I made an application that at a certain low time Pdfs, however I can only download a PDF. I wanted to download several PDF, see the project. The part that’s making the mistake is in the for, where I…
-
-5
votes4
answers2193
viewsHow do I search a value within a String?
I created a EditText for the user to enter a value, and as soon as they click the search button on String the value entered by him, but I would like to know how to search some value within the…
-
-5
votes1
answer8631
viewsPHP or Java ? Positive and negative points
I’m using the PHP not long ago, and even using a framework, enjoying the Object Orientation me yet nay have the perception to see the limitations of language. For example, if one language supports…
-
-5
votes1
answer138
viewsJava, IPVA Expiration Check According to Car Board
I have to check the IPVA maturity, but I have no idea how to do it , since every year changes and for a due date there are several end plates.
-
-5
votes1
answer503
viewsCreate a numerical sequence by storing in Arraylist
I need to develop a Java algorithm that returns the following sequence: 9, 16, 25, 36, 49... I’ve identified that the pattern is as follows: 9 = 3² 16 = 4² 25 = 5² 36 = 6² Values need to be stored…
-
-5
votes1
answer1047
viewstry to execute the javac command but no longer execute
I’ve tried it anyway, fix it , already been on google , youtube , when I will try to run cmd "javac" it does not run speaks the following error " javac " is not recognized as an internal or external…
javaasked 8 years, 3 months ago breno dantas 1 -
-5
votes1
answer3666
viewsHow to convert an entire string?
How do I convert a value of type string that needs to be stored in a variable that is of the type int? Here are some conversion codes which are most appropriate to use in this conversion? A.a =…
-
-5
votes1
answer84
viewsHow do I get my Program to access the net?
I actually want to create a program that lets me know that my Internet connection is down, but I want to create it. I have some notion in java, but I wanted to know where to start. Do I have to…
-
-5
votes1
answer118
viewsSystem for legalized market
I have developed a system for the market that can be used for the shop too, I would like to know what to do to make the system legalized. I have to register? I have to go to SEFAZ? Which document…
-
-5
votes1
answer317
viewsHow do I place the for every 1 second?
I managed to put the effect of clicking on the button but still put a click every second because it is going too fast package gênius; import java.applet.Applet; import java.applet.AudioClip; import…
-
-5
votes1
answer358
viewsI can’t find the smallest number
Good afternoon Given a non-negative integer n and n non-negative integers, indicate which of these numbers is the largest and which the smallest. So far I’ve only been able to find the biggest My…
-
-5
votes1
answer184
viewsHow to modify a number of functions in Long for Biginteger?
The code below checks whether a number is prime in a sequence generated from a formula: package dec; import java.util.ArrayList; import java.util.List; public class Dec { private static boolean…
javaasked 8 years, 5 months ago Lorenoobster 21 -
-5
votes1
answer77
viewsJava error method main is Too Complex
My code is displaying the following message "method main is Too Complex" when I use several conditions in if to analyze repetition of numbers. With less data in if it works, but I need all these…
javaasked 6 years, 2 months ago Weriky Alphazero 37 -
-5
votes4
answers278
viewsWhat is the Java command that returns the uppercase characters?
For example, "Jorge Aragão Silva" ai returns me "J A S"
-
-5
votes2
answers1037
viewsHow to make an infinite count loop in Java?
I am starting my studies with Java now and I would like to know how to do an infinite count I’m having difficulties, because I know that in Python it would be something like: a = 0 while True: a = a…
-
-5
votes1
answer66
viewsI need some help!
I started studying object orientation and I need some help. I don’t understand the question Could anyone help me. With the Client and Person classes: a. create a client instance b. create a person…
-
-5
votes3
answers4815
viewshow to install java JDK and JRE in windows 10?
Hello; I’m doing the Android development course. I’m on: Section - 2 - Installation and configuration in windows Class - 5 - Java installation, JDK and JRE PROBLEM - I am unable to perform the…