Questions tagged as 'java'

2
answers

Differences between Date, DateTime and Calendar in Java 7

I am using Java 7 to develop an application to schedule conferences. I have seen that there are several types of data to handle the dates. Example: private Date creationDate; private DateTime creationDate; private Calendar creationDate...
asked by 27.01.2016 / 07:33
5
answers

Method Save to Java with classes

I'm doing a java project with forms which I have to save and delete for this I think a class that is the class connection a different class for each of the forms in which the different methods of saving modify and eliminate and the forms. but...
asked by 30.12.2016 / 17:18
3
answers

When is onDestroy what happens with the classes instantiated in the activity?

Good morning, When an activity is destroyed on Destroy what happens with the classes that were instantiated in this activity, are they also destroyed or are they loaded in memory?     
asked by 13.12.2016 / 02:48
1
answer

Calculate the value (ASCII) of each word (sum of the value of the letters) of a sentence within an array

I'm doing an exercise that is about calculating the value of each word in a sentence that the user enters. I wanted to know if you could help me know how to do it, thanks! What I want to do is calculate the value of a word, or the same, calculat...
asked by 13.12.2018 / 13:44
4
answers

Should I always use a servlet to work with web applications?

I want to create a web application using Java. I have some knowledge of the language, and when searching online tutorials they always mention the creation of a servlet . Is it necessary to learn and use servlets to create these types of ap...
asked by 05.12.2015 / 18:21
2
answers

Fill an n * m matrix diagonally

I have a problem that involves matrices, what I need to do is fill a matrix of N * M of dimension (that is, of a number n of columns and rows given by the user), with even numbers. example: I have come up with the code, but I can not ma...
asked by 22.11.2018 / 19:27
1
answer

Find hidden word with regex

I'm trying to find a hidden word with regex, but I do not understand why my code does not work. String s = "ahwereovnkejfnlvienfvia"; String regex = "[a-z]h[a-z]o[a-z]l[a-z]a[a-z]"; String regex2 = ".h.o.l.a." Pattern p = Pattern.compile(regex...
asked by 12.08.2017 / 14:41
2
answers

JAVA: Program that reads an integer and a position

I was given an exercise so that in Java I could do a program that read a multi-digit integer and a position; and then show on the screen the number of the number that is in the indicated position. For example, for number 1234 position 1 should r...
asked by 08.05.2018 / 16:56
1
answer

Listen from a different port SOCKET

I have the following program: Server import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; public class Professor { public static void main(String[] args) throws IOException { t...
asked by 03.04.2018 / 17:19
1
answer

WiFi scans are not received when running startScan () on Android 8 with targetSdkVersion 26+

I'm working on an application that uses WiFi scans to work. I use the method startScan() of the class WifiManager and I have programmed a BroadcastReceiver to be notified when the scan has finished and the results can now be...
asked by 21.05.2018 / 12:02