Questions tagged as 'java'

2
answers

Is it possible to center the ActionBar text?

I wanted to know if it is possible to center the ActionBar text, by default it comes to the left. By default: Centered (This is how I would like to put it): Is it possible? Thanks! Edit 2: MainActivity.java package p...
asked by 18.12.2016 / 01:18
3
answers

Does anyone explain to me what the trace makes the Fibonacci code recursive in Java?

Good morning. I am trying to draw the trace that follows this recursive fibonacci Java code to see exactly how recursivity works in this case. I do not quite understand the exact operation in this particular case since in the return it is assume...
asked by 01.03.2017 / 16:26
2
answers

Use the same Runnable in two different Threads

class RaceDemo { public static void main(String[] args) { Racer racer = new Racer(); Thread tortoiseThread = new Thread(racer, "Tortoise"); Thread hareThread = new Thread(racer, "Hare"); //Race to start. tell t...
asked by 26.02.2016 / 19:49
4
answers

How do you call a method from another class?

Hello, sorry, I have a problem in my java studio? How to call a method from another class? Example: public class metodos { public static void mensaje(){ System.out.println(" hola mundo "); } } example I have this For exampl...
asked by 07.10.2016 / 03:35
2
answers

Display two array instances

Good morning, I am involved in designing two boards for a game (Sink the Fleet), in small steps, I have a class MyDesk where I have created two instances of the board, however, when calling both from a main class ( MyDesk barco = new M...
asked by 22.04.2016 / 12:21
1
answer

Doubt with the treatment of a manyTomany and oneTomany scheme mixed

I'm doing an event management web project for class with java, jsp, hibernate h2 and maven. My question is, how do I associate users with the events and both with the table? I mean, I want the application to remember which user has registered to...
asked by 25.05.2016 / 21:45
2
answers

How to make the PlayStore open if an app is not installed?

I'm trying to get the code to detect if an app is installed on the phone and if it is open, if it is not then open the PlayStore or rather search for the app to that is downloaded. public void open8 (View view){ if(InstaladaAplicacion("...
asked by 19.09.2017 / 00:21
3
answers

How to enter arrays by constructor? Arrays java poo

I have to do a program to enter arrays in the main and then show the number plus its position, I wanted to enter arrays by the constructor and it does not leave me. Is there another way to do it? public class IngresoDeEnteros { private int nu...
asked by 05.12.2018 / 01:42
3
answers

What is this.dispose for?

I saw this part of a code on the internet: I found it looking for something I needed but it did not change the functionality of the rest of the code, I wanted to know what it was used for.     
asked by 17.09.2017 / 18:33
1
answer

ArrayIndexOutOfBoundsException when selecting input value [closed]

In my program, when you enter the query menu, the user is asked for a series of data. When you reach the section where you enter the month of your birth this menu does not appear, the program is closed and the following exception appears: Exce...
asked by 16.02.2017 / 05:28