Questions tagged as 'java'

4
answers

Convert Date () to String

I want to convert the type Long that returns new Date().getTimeInMillis() to String The following code does not work, generates a time different from my time zone private String formatDate(Long fechaInTypeLong) { Da...
asked by 02.11.2017 / 04:31
1
answer

Go through and return a Java HashMap in order

I have the following HashMap Map<String, Float>notas = new HashMap<String, Float>(); notas.put("Examen 1", 8.0F); notas.put("1er trimestre", 9.4F); and I have the following method to go through it and show it on the screen @Su...
asked by 01.11.2017 / 21:45
3
answers

Error "No suitable driver found for jdbc: mysql: // localhost / dda" when connecting to MySql from Java

I would like to connect to a database that I have locally. I have the service up, and I already have the base created. as shown is localhost, root pass 1234, and I have 2 user and oid tables, I have the following Java class to use...
asked by 02.12.2017 / 22:09
2
answers

Inject objects into Java

I'm used to working with Java EE where you can simply inject objects with the @Inject annotation however I do not know how to do it without using Java ee. What I want is that the same object with the same instance can be used in different cla...
asked by 27.12.2017 / 23:10
2
answers

Doubts in operation

Could someone give me a brief explanation about the results of these operations? System.out.println(1<<4); System.out.println(1>>4); System.out.println(5>>2); 16 0 1 Here I leave link where I tried them.     
asked by 16.09.2016 / 16:20
1
answer

Because I can call a method without using objects of this even though it is not static

very good community my question is the following. I would like to know why I can call a method of a superclass in my subclass without creating an object of this type and in addition to not being static. is what happens below, I use an inher...
asked by 22.12.2017 / 04:34
3
answers

Draw figures in Java

How can I draw a star in java? The part that confuses me is that of the coordinates in g.drawline because I do not understand in what order they are written and how to give me an idea of the correct coordinates to draw a star. This is what I...
asked by 07.02.2017 / 00:45
2
answers

Control of Activities

Hello, I have the following problem. In a Activity I have a button that executes a AsyncTask . The problem is that if the app is completely closed, the operation is not executed. Is it possible to call an Asynchronous method when...
asked by 01.12.2017 / 16:05
3
answers

How to create new activity in AndroidStudio 2.3.3?

Hi, I would like to know how to create an activity in AndroidStudio 2.3.3, about 1 year ago I created activities with something similar to this: Intent i = new Intent(algo,algo); i.startActivity(); But I see that currently the startActivity...
asked by 17.06.2017 / 14:40
2
answers

Using many JFrame? (the ones Netbeans brings by default)

I do not know if there will be a good practice for this, since I have a screen with a JMenu with many items ->Menu ->Usuario { ->Iniciar sesion ->Registrarse ->Informacion de usuario } ->Ayuda {...
asked by 26.02.2017 / 16:33