Questions tagged as 'java'

2
answers

Get JSON data that returns a URL through Java

I'm trying to get some specific data from an http request, this request returns data in json, here's an example: { "Head" : { "RequestArguments" : { "DataCollection" : "", "Scope" : "System" },...
asked by 20.06.2016 / 08:30
3
answers

Why not use if within a cycle for

Hello, my question is this: for (int i = 2; i < n; i++) if (n % i == 0) return false; return true; Given an example like anybody like this where I have a if within a cycle for , the teacher told me:...
asked by 24.01.2018 / 05:19
4
answers

Java; a program that reads a phrase and displays the words in the reverse order

Hi, I do not know how to make this program read a phrase and show it in reverse, for example: String frase = "Me gusta programar."; and that shows: System.out.println("programar. gusta Me"); Thank you community: D     
asked by 17.01.2018 / 19:37
2
answers

Separate a URL in its parts

I am trying to write a method that is called separarURL() , that receives a string of characters from a URL and returns an array of three Strings, containing the protocol, the server and the resource of the received URL. Example:   ...
asked by 16.01.2018 / 16:04
3
answers

Check if there is a comma and replace it with a period

I have an EditText where I pick up what was entered in the box and I am trying to verify if it introduced commas, letters where only a format like this is allowed: 123.11 If the user enters the parameter other than a value of type Float the a...
asked by 27.05.2017 / 19:10
1
answer

Java doubt: .Equals ()

At work I'm using Java and I have to use the equals () function frequently. My question is what is the difference between !"".equals(objeto); in front of !objeto.equals(""); At work they force me to use the first, but I do not under...
asked by 09.07.2018 / 13:04
1
answer

Difference between \ r and \ n JAVA

are known as escape sequences. I have been testing some, and I have seen that \ r and \ n generate new lines, although they have different definitions and as I have read, also different functions. Does anyone know the difference? System.out.pr...
asked by 11.06.2018 / 18:31
4
answers

create a variable of type class

Sorry if my question is wrong, but I have the following question, I am just learning java and I know the variable types are int double String , etc .. but I have noticed that you can create a variale of type 'name of the clas...
asked by 21.04.2017 / 00:51
4
answers

show query result Spring java in the view

Vista: <body> <p>Hola bienvenido</p> <c:forEach items="${datos}" var="dato"> <c:out value="${dato.ID}"/> </c:forEach> </body> Connector: (the connection works) public Drive...
asked by 01.04.2017 / 05:35
2
answers

IF conditional in SQL query

I am developing a Java web application in NETBEANS and I have a query which shows numerical values only, when I execute my query it shows them in an organized table, everything works perfectly. What I want to do are 3 conditions "IF" with the...
asked by 17.04.2017 / 18:46