Questions tagged as 'java'

2
answers

What does the @Component annotation?

What does Spring actually do when we put the @Component annotation in a class? How It Works "Beneath the Cloths"     
asked by 08.03.2016 / 20:21
2
answers

Power method and exception handling

I have to solve the following exercise but I have some doubts: Create a class that only has a power method, which receives 2 numbers and calculates the number 1 to the number 2. This process should contain an exception if any of the...
asked by 15.03.2016 / 18:12
3
answers

Maps in Java: picking key from the value

Hello, I have a string map for string: Map<String,String> myMap = new Map<String,String>(); with a series of values myMap.put("1","valor1"); myMap.put("2","valor2"); myMap.put("3","valor3"); I would like to know what is...
asked by 31.03.2016 / 22:20
2
answers

How to read data from txt files using Java?

Is there a mechanism for storing the data of a .txt file in a LinkedList? For example, how would this list have the Strings "Caio", "Peter" and "Luiza" as elements? import java.io.*; public class teste { public static void main ( S...
asked by 15.07.2015 / 22:20
2
answers

Problem between C # system and Warsaw plugin (GAS Technology)

My project was built with the C # language. It was all happening smoothly, until some customers started reporting errors when opening my system. The error occurs as follows: the client clicks the shortcut on the desktop and the system opens (usu...
asked by 26.10.2015 / 12:58
2
answers

JSONObject with multiple values without using Array

Objective Create a JSON with the following structure: { "auth": { "user": "rbz", "token": "abc123" } } Scenario Creating the root structure: JSONObject JOraiz = new JSONObject(); Creating the values us...
asked by 29.11.2018 / 11:11
3
answers

Remove 2 specific characters from a String

Good afternoon! Devs, I can not solve the following problem: In a calculator app, the calculations always return a Double, which automatically inserts a decimal even if it is to deploy zero, and to show in the editText would like to remove the "...
asked by 27.11.2018 / 21:26
2
answers

Format date in java

I need to format a date that comes up for example: 20161109103000 to 2016-11-09 10:30:00 . I've tried using SimpleDateFormat , DateTimeFormatter and could not format the date.     
asked by 22.08.2017 / 15:31
2
answers

Is it a bad idea to versionarmos classes automatically generated with JiBX?

Where I work we have a (very old) project that uses JiBX to generate some classes from schemas . These classes are generated in the build so the source does not exist in the project. Someone gave the bright idea of getting these source g...
asked by 26.07.2017 / 21:08
1
answer

Can I have more than one builder per class?

The question is simple personal: Can I have more than one constructor in the same class? At first, I'll need to set the plugin variable in my object, so I'll use the constructor that defines that variable; public RankAPI(Main main) {...
asked by 03.07.2017 / 21:20