Questions tagged as 'java'

2
answers

Close a Java program at any time

Java doubt The question I have is about how a program in Java could end at any moment of the execution by writing a specific word.     
asked by 11.10.2018 / 10:23
2
answers

Play a GIF Image on a JPanel without using URL (JAVA)

Good! Look, I have a class called GIFPanel that inherits from the JPanel class package Trivia; import java.awt.Graphics; import java.awt.Image; import javax.swing.JPanel; public class GIFPanel extends JPanel{ private Image imagen;...
asked by 31.01.2017 / 00:21
2
answers

How to know if the first character of a String is an int?

My problem as the title indicates I want to know if the first character of a String is a number 9. I have the following code but I want to know if it can be optimized: String palabra = "9394"; if(palabra != null && palabra.contains("9"...
asked by 20.03.2018 / 19:25
2
answers

Unable to remove a space in java

Good morning, I'm trying to remove a space with java. The value I get through scraping, for example the value 11 990,00 . I've tried with: .replace(" ", "") .replace("\S", "") .replace(" ", "z").replace("z",...
asked by 26.04.2017 / 10:58
2
answers

Round 2 decimals in Java

Good, I have this method done in Java and the result that returns is a number with many decimals, I would like some way for me to return two decimals only. Code: public static float calcularMedia(int[] notas) { float resultado =...
asked by 28.08.2017 / 10:56
2
answers

What is the difference of While and Do While?

I wanted to know if you can give me a basic definition (I'm new to this, that's why I ask for a simple explanation: /) and not so complex of the while and do, especially of the while I have more doubts because I do not understand what it is what...
asked by 05.10.2018 / 20:25
5
answers

Java. Call a method that returns an array and display it without displaying the memory address

My question is, how can I show from my main, a method that is returning an array without returning a memory address ?. My code is now like this. Main System.out.println(ciudad1.getMaximas()); //Aqui quiero que me imprima lo que contiene el ar...
asked by 28.01.2017 / 15:45
1
answer

What does the following yellow icon mean in Eclipse?

In my Java project with Eclipse, I realized that next to the icon of each class appears an icon in the form of a cylinder? I would like to know what the meaning of this icon is:     
asked by 18.12.2018 / 12:59
3
answers

How to put a secure java license [closed]

Hi, I have to do registration (it will be composed of 4 consecutive numbers followed by 3 consecutive letters, without blank spaces between numbers and letters). And I want a method that receives a string enrollment and check that it has an appr...
asked by 07.02.2017 / 09:02
2
answers

How to show matrix top right triangular java

Hello, good as I show the upper triangle of this matrix, thank you! System.out.println("Mostra la matriu"); for (int i = 0; i < mat.length; i++) { for (int j = 0; j < mat[i].length; j++) { System.out....
asked by 22.02.2018 / 19:00