Questions tagged as 'java'

4
answers

how to compare the letters of a String that are written of distinctly

hi what basically is that we can compare one string with another to see that they are the same example String n1 = "hola"; String n2 = "hola"; we could use: n1.equals(n2) but my case is that I am doing an exercise of triploid words whi...
asked by 03.05.2018 / 06:01
2
answers

help error can not format given object as a date

Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Date at java.text.DateFormat.format(Unknown Source) at java.text.Format.format(Unknown Source) at examen.rutina.RutinaArchivos.obtenerNombreZip(...
asked by 21.10.2016 / 21:50
2
answers

When in.close () is used; of the Scanner class?

I am trying to compile the program to know if it is even or odd and I get an error "Resource leak: input never close", where it is recommended to close the Scanner? package pares; import java.util.Scanner; public class Pares { public stati...
asked by 16.05.2017 / 02:42
3
answers

Move from String to Double avoiding Null error and Malformato in Java

What is the optimal way to pass a String to Double ? Taking into account if the string is null is equivalent to 0.0 and if there is no number to convert also 0.0 0.125 > 0.125 a3.72b > 3,72 abcde...
asked by 16.11.2017 / 20:15
3
answers

Print list of objects in java

I am consuming a web service that returns a list of objects, the list contains 10 objects and each object contains 5 attributes nombre , placa , sexo , direccion , fecha . What I need to know is how to reccre the...
asked by 22.04.2017 / 17:28
3
answers

assert vs. null in Java

Often when I'm clicking code the Android Studio warns me that such a function can return @nullable, its recommendations are two: Enclose everything in an if you check if the object, variable, function is null or use the statement asser...
asked by 22.03.2016 / 18:04
3
answers

What is the best way to run batch with java? [closed]

Hello, I would like to know what is the best way to run batch files with java, the ways in which I think it can be done is doing everything from java. For example, I have to execute certain commands via ssh I think I could connect from java and...
asked by 08.04.2016 / 18:26
2
answers

Separate Double values in their Entire Part & Decimal

you want to separate a Double value for example Double entrada = 34.567 and process it so that the result is: Parte entera: 34 Parte decimal: 567 but that the value after the decimal point leaves without the 0. (nu...
asked by 06.12.2018 / 03:39
2
answers

How to perform this exercise with arrangements in JAVA

I have managed to advance a little, I have put the instructions of income but the instructions of calculation I can not do them :( Help please /* “El náufrago satisfecho” ofrece hamburguesas sencillas (S), dobles (D) y triples (T), las cuales...
asked by 04.11.2018 / 05:24
1
answer

Get Date from the Database

I need to get the date (in particular the year) from the database to integrate it into Java String now = "SELECT DATE_FORMAT(NOW( ), '%Y' )"; try { java.sql.Statement sp=cn.createStatement(); ResultSet RS = sp.exe...
asked by 20.11.2018 / 18:03