Questions tagged as 'java'

1
answer

How to print all the divisible numbers of a number entered by keyboard? Java For

Hello, good, I'm doing a program where I must perform the division of two numbers and if it evaluates if the first number is divisible by the divisor, if so, print all the divisible divisible numbers. So far I did odd and even numbers, but it on...
asked by 02.12.2018 / 01:17
1
answer

Help with Socket in java

I hope you can help me, I am a little or very confused with Sockets in java, the exercise is the following ... Create a server client application where the server "thinks a number" in an interval known and the client tries to guess it. The cl...
asked by 03.11.2018 / 20:42
1
answer

Help with Socket and files in Java

You see, I'm doing this exercise ... Create a server client program where a client asks the server for a file and it is sent to the client and then printed on the screen. The problem I have is that I can not pass the contents of the file,...
asked by 04.11.2018 / 00:44
1
answer

ReentrantLock .lock

The lock method of the class ReentrantLock blocks the code that is enclosed by the lock and the unlock . If the code is already blocked, the next thread that tries to execute that code waits until it is unlocked or con...
asked by 02.03.2016 / 01:10
1
answer

Return attributes of HttpServletRequest with RequestContextHolder

I am working with JWT and it is necessary to handle the claims from a class, for this create the following AuthContextHolder.java : package com.payulatam.ppp4.secure.api.controllers; import javax.servlet.http.HttpServletRequest; impo...
asked by 04.03.2016 / 16:15
4
answers

How to do a factorial for my calculator [closed]

I'm doing a scientific calculator. This calculator has several mathematical functions for the number entered. For example, in this code the square root is calculated: if (e.getSource() == boton[11]) { if (!entrada.equals("") && !en...
asked by 17.03.2016 / 16:56
2
answers

Help Netbeans java error in cycle for [closed]

Hi, I have the following problem, in my university I opened the same project and it worked correctly, but in my house, I released this error. JSP: <%@page import="controlador.AccesoDatos"%> <%@page import="modelo.*"%> &l...
asked by 24.06.2016 / 19:15
3
answers

How to show in jframe the results of the sql statement?

I would like to know what I am doing wrong in the code, it turns out that I try to get the data of the statement sql in the JFrame . I leave the code what I have package Formulario; import Formulario.Menu; import Clases.*; import jav...
asked by 25.06.2016 / 00:16
1
answer

java.lang.ArrayIndexOutOfBoundsException: 0

I have this class in java: public class matriz { private int tamMatriz; private int[][] mainMatriz = new int[tamMatriz][tamMatriz]; public matriz (int tamaño){ tamMatriz = tamaño; } public void instanciarMatriz()...
asked by 02.11.2018 / 07:34
2
answers

Doubt with literal b of this exercise

Very good to the whole community I am new and eager to learn in java. Well my doubt lies in the literal b, my code I have it this way. In a class called Person you have two methods and one variable, the variable is called typeBaile and is pri...
asked by 26.10.2018 / 17:56