Questions tagged as 'java'

4
answers

How Does Inheritance Work Between Classes?

I can not understand something simple, I explain below: I have the class MainActivity.java (The main one) and then I create another class of name Funcion.java so in the Function class all content (This all empty) public class Funcion...
asked by 19.05.2018 / 21:44
3
answers

How can I separate a string from a string

I need to enter a date, that you enter as string example: 21/10 / 2016-12: 04, and these data convert each one into a data type, (int, byte), to make validations and then enter them to a calendar     
asked by 21.10.2016 / 07:07
2
answers

Error in android java.util.ConcurrentModificationException

I'm doing an app for Android , and part of my code is like the following: public void loop(){ for(Car car:carList) car.run(); } The bad thing is that I get the error java.util.ConcurrentModificationException . I was re...
asked by 27.10.2016 / 04:39
3
answers

Problem with while loop together with if conditions

I have a problem that I think any intermediate programmer can solve. The case is that I have a while loop in which if I put in the input (for example) "add" and add the numbers the subtraction is done but then the while is executed again and it...
asked by 02.12.2016 / 21:28
3
answers

Problem with the methods and constructor?

I have a small code in which the purpose is to verify the user's name and see if it exists in an array and the age verify if it is of legal age. If it is, you are authorized to enter the system. The code is not finished yet but my doubt is th...
asked by 08.01.2017 / 21:32
1
answer

Go through adjacent positions of a matrix

I'm making a game that aims to fill all the squares of the same color (in this case the numbers will be the colors selected by the user who is playing, and in a matrix with dimensions of 9x9). The fact is that I have already done how to generate...
asked by 04.01.2017 / 14:12
1
answer

Get the stack trace in Java without printing it

How can I get the stack trace at a position in the code when no exception was generated? I come using try { // código } catch (IOException e) { e.printStackTrace(); } or even e.getMessage() within an exception, but I am interest...
asked by 06.01.2017 / 04:19
2
answers

Java. Improve iteration speed

   Example       For a = [2, 3, 3, 1, 5, 2] , the output should be    firstDuplicate(a) = 3 .       There are 2 duplicates: numbers 2 and 3 . The second occurrence of 3   has a lower rate than the second occurre...
asked by 27.11.2017 / 03:05
1
answer

Can you manipulate the hdmi output with java?

What I want to do is from an application to generate images and watch them on a TV connected to the pc by hdmi, the idea is that the TV does not show the interface of the application or the interface of the operating system, but only the image t...
asked by 06.03.2017 / 02:05
2
answers

How to change the value of a static variable?

Good, I would like to know how I can change the value of the following constant (To give an example) by a method. private static double PIVA=0.16; Edit: I have expressed myself poorly, I am sorry. I misused the word "constant", I wanted to...
asked by 27.04.2016 / 21:42