Questions tagged as 'java'

3
answers

How to differentiate device type from IP?

How do I know what kind of device is using an IP? I wonder if there is any way to validate whether an IP belongs to a computer, a mobile device, etc. This is to differentiate device types from IP. I'm interested in doing this in Java....
asked by 10.08.2016 / 13:46
3
answers

How the switch works

Is it possible to make comparisons with variable values in the switch case statement or the case just check the value of a variable and do an action? Is it better to make this type of comparison with if ?     
asked by 09.02.2017 / 23:53
1
answer

Get list of persistent JPA / Hibernate objects

Hello, how do I get the list of persisted objects before committing it to DB. Here's the example below: Pessoa p = new Pessoa("Joao", 21); Pessoa p2 = new Pessoa("Pedro", 17); Pessoa p3 = new Pessoa("Maria", 32); //Entendo que nesse momento o...
asked by 03.03.2015 / 13:02
4
answers

Calling GridView event in Activity

I have a GridView adapter and I have a ImageButton to delete the items. It is deleting correctly, however, every time an item is deleted I need to set the current quantity to a TextView that is in another Activity . I can n...
asked by 04.03.2015 / 18:30
2
answers

How to display information about objects in my ArrayList?

I want to create a ArrayList to store information about students (name, typing number and status) but I can not get ArrayListadded the information. The code I have is the following: Turma.java package turma; public class Aluno {...
asked by 29.05.2017 / 20:10
0
answers

Parsing an XML and their respective XSD

I need to parse a WADL manually and create an XML specification that I have here. Example: - > File YahooSearch.wadl [...] <application * xmlns:yn="urn:yahoo:yn" * > <grammars> <include href="NewsSearc...
asked by 04.11.2014 / 19:00
1
answer

Loops based on a flowchart

How do I write code for a loop based on this flowchart? It has do...while . I need a straightforward answer with nested loops.     
asked by 02.11.2017 / 03:54
2
answers

Launching exceptions based on prime number

   Write a function that receives a number, throws an exception if the number is not positive and returns true if it is prime, or false, otherwise. My answer: public static void main(String []args) throws Exception{ Scanner sc = new Sc...
asked by 19.08.2016 / 18:46
1
answer

You are not converting INTEGER to String

Good afternoon, my application has the function of monitoring virtually a football game, and it contains a button that saves the team name and the number of goals that the team did ... Only when I click the button save it says that the applicati...
asked by 16.10.2016 / 20:26
3
answers

Call a class method

How can I display the method of this revised class in the Test class? public interface Produto { void exibirNome(String nome); } public class Revista implements Produto { @Override public void exibirNome(String nome) {...
asked by 17.12.2016 / 23:42