Questions tagged as 'java'

1
answer

When the third Spinner data is selected, the Activity corresponding to the Spinner is closed

The window where the Spinner is located is closed when I select the third option of the Spinner, with the first and second there are no problems ... This is the error in the Logcat 05-03 00:57:29.436 11301-11301/? E/AndroidRuntime: FATAL...
asked by 03.05.2018 / 15:07
2
answers

Print a char with println

I have this code: System.out.println((char)-1); I get it, with -2 with also, with -3 it changes to and with -4 it does not print anything. Why these results? Thanks in advance. Greetings     
asked by 27.04.2018 / 13:04
2
answers

How do I separate a line of text and store it in a vector in Java?

I have a text file, which is read and stored in a variable linea , then I separate the content of the line with linea.split(); . How do I make the content stored in a vector, being already separated? For example: 4 1 H 6 O 3...
asked by 09.09.2016 / 17:05
2
answers

How can I print the values of a TreeMap?

This does not return anything to me: System.out.println(tree.values()); , castings do not work, i.e. System.out.println((int)tree.values()); How do I print the key values collection? Map<Integer,String> tree=new TreeMap&...
asked by 26.09.2017 / 04:23
1
answer

SpringBoot error when creating Api Rest

I'm learning how to use SpringBoot and I can not make it work with the classes I created, I'll leave the code in case you can help or pass some link from a tutorial or video that explains it in a simple way the use of the framework. import o...
asked by 23.11.2017 / 12:03
2
answers

Configuration TomCat Netbeans Local

Currently I download the version of netbeans The version that brings Apache Tomcat, once this I am directed to netbans to create a WEB project, I choose Apache TomCat which brings me to this configuration screen My goal i...
asked by 23.11.2017 / 13:29
2
answers

Print twice "Wrong date". Conditionals in Java

I have to have it print "correct date" when I write a date within the ranges considering months of 28, 30 and 31 days. When I insert by console for example 31/4/1982 (a date that is incorrect because April has 30 days) I print "Wrong date" twice...
asked by 06.12.2017 / 16:53
2
answers

Problem with spaces in Android

I have a form in android which communicates with a WebService to fill a database of MySql , the problem is that when I run the app and write in the editText for example the name, if I write two words the data does not reach MySQ...
asked by 24.08.2017 / 03:13
2
answers

Read several lines of a JAVA text file

I need to be able to read several lines of a .txt with a specific format per line (String, int, int) for example (Erick, 99,88) . After that, make a split of each line, using as a parameter for the split a comma, to be able to op...
asked by 19.05.2017 / 03:23
1
answer

What is charAt (0) used for?

I have an example code that says the following: (uno.getText().trim().charAt(0)+"\n"+ dos.getText().trim().charAt(0)+"\n"+ tres.getText().trim().charAt(0)+"\n"+ cuatro.getText().trim().charAt(0)); We did this to show in texta...
asked by 06.08.2017 / 20:49