Questions tagged as 'java'

2
answers

Spring - @Autowire a List with elements

I have a controller that has this @Autowired: @Autowired Rules rules; This Rules class is defined as follows: @Service public class Rules { @Autowired private List<RegistrationRule> allRules; public List<Registratio...
asked by 06.07.2018 / 17:39
2
answers

Firebase Cloud Messaging (FCM) - Push Notification (Java)

I'm working on a backend I'd like to use to send / Push notifications to android app using Firebase Cloud Messaging (FCM). I've read the documentation ( FCM a few times), but I still have many questions. I know you can use the Admin SDK o...
asked by 12.04.2018 / 01:56
3
answers

Comparison between objects via loop, If and else?

I'm a beginner in java and I'm having trouble comparing objects through a loop. I'm developing software for an MVC (Model-view-controller) design video store and want to know how the person object compares through its code with zero. When I make...
asked by 20.10.2015 / 21:09
2
answers

JSF - Loading bar while executing a Java method

Good morning, I have a login screen, and when the user clicks the Enter button, I want to be an incone showing "loading" while the java method is executed. Follow my xhtml code: <?xml version="1.0" encoding="UTF-8"?> <title &g...
asked by 27.05.2016 / 14:26
2
answers

How to write a txt file with the name of each patient?

I am developing a college project that is a clinic system where the receptionist makes the patient's registration and other more options. I want to have the employee register a new patient, the form is saved with the patient's name individually....
asked by 09.06.2016 / 20:40
2
answers

Difference between primitive type and object in Java

In Java, we have so-called primitive types and so-called objects. What's the difference between the two?     
asked by 05.02.2018 / 17:47
1
answer

Replace in backslash "\" in java

I need to take the backslash ("\") of a string, I've researched in a number of ways, but none worked. Please help me, follow code. f = new File(path,prefix + "_" + dataArq + "_" + pesquisa.replaceAll("\", "") + ".txt"); System.out.println(p...
asked by 20.07.2018 / 22:17
1
answer

How to make a greedy algorithm to solve the backpack problem in java [closed]

Remembering that I can not do the calculation to solve this problem     
asked by 03.05.2018 / 17:10
2
answers

Android - Open Random Activity

Well, my question is: Can I make a function call a Random Activity?     
asked by 07.05.2018 / 22:00
1
answer

Validate text with regex

I have the following code: final String msgRegex = "Produto [a-Z0-9À-ú, ]*"; final String msg = "Produto Soja"; if (msg.equals(msgRegex)) { System.out.println("Verdadeiro"); } else { System.out.p...
asked by 26.03.2018 / 15:10