Questions tagged as 'java'

2
answers

Error comparing values in Android (if)

I have the following Activity which starts a service type service on android for it within my class Activity I have the following Intent i_service = new Intent(getApplicationContext(), MyService.class); i_service.putExtra("nombre_clase...
asked by 05.05.2017 / 08:21
3
answers

How to instantiate a public void object in JAVA?

I have a public class where I write the methods and the main from which I instancio to solve the exercises / problems. I wish to instantiate the following method: public class metodos { public void espositivo(int a) { if (...
asked by 20.06.2017 / 23:32
1
answer

Error [I18N] Hardcoded string in android studio

It was not until recently that I learned in Java what I needed to program applications on Android and I am practically a novice in this technology, it would help me a lot if you helped me with this warning message:    Message: [I18N] Hardcode...
asked by 30.06.2017 / 10:59
2
answers

Java 8 JRE 8u111 or 8u112, which is the best / correct? [closed]

On the Oracle website, two versions of Java JRE are offered, I would like to know which of the two is the correct one to install to develop in Eclipse Neon using Java. Link: link Java SE Runtime Environment 8u111 Java SE Runtime Envir...
asked by 28.11.2016 / 01:38
2
answers

Print the upper and lower triangular of a java matrix

I am trying to print the upper and lower triangular of a matrix. In this case I choose the 1 2 3 4 5 6 7 8 9 The code is this: public class matriztriangular { public static void main(String args[]) { int[][] matriz = { { 1, 2, 3 }...
asked by 23.01.2017 / 12:03
1
answer

Problem when doing an exercise with threads in Java

Good, today started with threads and I am a little lost, I made the following code to make a program with two threads of name "HiloUno" and "HiloDos" so that each of them visualize the first 10 natural numbers . But I think I've got it wrong....
asked by 26.10.2017 / 21:50
2
answers

Connect Java with SQL Server 2017 in Eclipse Oxygen

I am using Eclipse Oxygen to develop a Java program and I want to use SQL Server 2017 to save the information. I read in other places how to do it, but, it does not work for me. Steps I've done so far: I downloaded the Microsoft JDBC Dri...
asked by 05.11.2017 / 03:31
1
answer

How to debug an infinite loop

Hello, I am creating a game in POO (I can not use polymorphism, interfaces, inheritance, overwriting of methods, among others. It is generating an infinite loop and I do not know where the error comes from. I have not set class 1 (main...
asked by 02.02.2017 / 18:38
3
answers

Error closing Connection, Statement and ResultSet within try-catch-finally in Java, can not be resolved as variable

I still have problems to close my connections correctly, the error I have now is that the variables of Connection, Statement and ResultSet, says that I must create them locally, so what should I do?. My code: String showTableSQL = "SELE...
asked by 26.11.2016 / 14:18
1
answer

if and else if, java in android studio [duplicated]

I wanted to know how I can do so that if response is equal to id of Facebook, go to activity , and that otherwise go to another activity . When I try with: if (profil.getId().toString() == response) and I run...
asked by 05.01.2017 / 22:31