Questions tagged as 'java'

1
answer

what are the correct uses of contains; equals; e ==? to compare objects, Integers, Int, Strings ..?

what are the correct uses of contains; equals; e ==? to compare objects, Integers, Int, Strings ..? I know that sometimes they can be used the wrong way but I do not know well .. Thanks     
asked by 12.05.2018 / 17:14
2
answers

Problem with Java-interface

When I implement an interface in different classes I do not know how to access a variable of any of the classes public interface Enganchable { void enganchar(Enganchable E); void desenganchar(); } public class Locomotora implements E...
asked by 09.04.2018 / 11:16
1
answer

Android: How to use ImageButton?

I am something new in this of Android Studio, and now I want to put an Image Button but at the moment of coding it my App crashed when I try to compile in my cell phone. Any help? XML: <ImageButton android:id="@+id/telefono_ni...
asked by 28.04.2018 / 15:37
5
answers

Question for connoisseurs of Java and Visual Studio

Recently I'm starting to work with Java; I really have more experience with Visual Studio. So, since the environments are different, I'd like to know what the Java equivalences are: Desktop applications With Visual Studio I use WinForms...
asked by 09.08.2016 / 23:18
3
answers

String.split () to separate in spaces, but without replacing spaces

I have a String like the following: String foo = "soy un texto" When applying the following function: String [] bar = foo. split(" "); He separates it into three texts: "soy", "un" y "texto" However, I want to keep the space...
asked by 18.01.2017 / 19:24
1
answer

Change a decimal to binary with stack java

Good morning, I am trying to convert decimal to binary, octal and hexadecimal and vise versa, but does not show me the correct values nor could I pass from binary to decimal, any idea? public static void main(String[] args) { Scanner keyb...
asked by 28.03.2018 / 23:22
1
answer

Variable arrangement in Java

I need to make the length of the array declared by the user running the program and not established within the code, this is what I'm doing but I got confused and I do not know what to do as soon as I'm learning how to program. import java.uti...
asked by 05.04.2018 / 02:47
1
answer

2 font styles at once with swing

I need a little hand, I'm with swing and to apply a font to a text I can only enter the classic parameters: Font despues= new Font(estilo,Font.ITALIC,tamaño); The fact is that I need to use 2 font styles at the same time, specificall...
asked by 16.05.2018 / 23:13
2
answers

Move a point and go painting where Java passes

My problem is that I can move the circle but I can not make it repaint where it happens. I want him to leave color wherever he passes Code: import java.awt.Color; import java.awt.Graphics; /** * * @author isaac */ public class PanelG...
asked by 19.11.2016 / 00:06
2
answers

Modify "Points" binary file (modify by SEEK)

I need help with the following piece of code: case 1: System.out.println("Actualizar Puntos"); int registro = 1; // Nuevos puntos (entrada del usuario) punts = 40; // Posición donde comienza el registro int pos = 48 * (registro - 1); // Mover...
asked by 07.01.2016 / 15:05