Questions tagged as 'java'

1
answer

Java shortcut files

What I need to know is why when I enter a record to read, I skip the exception EOF that says there are no more records in the file. I have created in the code that each record that has a length of 44 bytes to go directly to a record. Then...
asked by 18.05.2016 / 19:38
10
answers

Force jump to catch

Is there any way to force the jump, without causing an exception, from inside try to catch ? For example: try { // Código // ... // //Provocar salto al "catch" -> ¿otra opción? Integer.parseInt( "hola" ); } catch(...
asked by 19.12.2016 / 19:02
2
answers

Why does NetBeans not recognize getApplicationContext ()?

something very strange that happens to me, is that I try to put getApplicationContext () and it tells me that    "can not find symbol" I do the corresponding import and does not give an error import android.content.ContextWrapper; Fo...
asked by 03.02.2018 / 22:00
4
answers

Counter that adds 2 in 2

It is my first post in this forum, I am starting to program, and this question has arisen in an exercise. I have to find the sum of the next 20 numbers to a number entered by keyboard, and the sum of the next 20 even numbers. This is my code:...
asked by 01.11.2016 / 13:11
2
answers

problem with writeObject in java

I'm uploading images to the server. The image is sent in an input file to my local server, I convert it into a byte array, I set the array in a model class (BasicFileAction) and then with an object of type URL I make a connection to a service in...
asked by 18.08.2017 / 14:22
4
answers

Doubt with java about content Array

Hello very good I'm doing a Java programming practice and I just need to finish controlling one thing but I do not take it out. I have an array with 5 elements which I create and fill them with. Well, the elements of the array contain the quo...
asked by 27.10.2016 / 12:02
5
answers

JAVA String: Difference between Null and ""?

public static void main(String[] args) { String frase; String palabra = ""; String mostrar = null; int i; int c = 0; frase = JOptionPane.showInputDialog("Ingrese al frase: "); frase += " "; for (i = 0; i...
asked by 17.06.2017 / 08:12
1
answer

Date output format with DateFormat

I want to have the following date format when doing System.out.println() : 31/03/2016 . Since I pass the format in a String type in this way "31-03-2016" , I use the classes import java.util.Date; import java.text.DateFor...
asked by 01.04.2016 / 07:46
2
answers

How can I send a message via WhatsApp to a specific contact from another android application?

I am developing an application that sent a message to a specific WhatsApp contact from my app. I already tried this code. Uri mUri = Uri.parse("smsto:+999999999"); Intent mIntent = new Intent(Intent.ACTION_SENDTO, mUri); mIntent.setPackage(...
asked by 31.03.2016 / 22:59
1
answer

What is the '' operator used for in Java?

I have a problem with the use of the character '> >' I would like to know what function actually fulfills what it does considering something like: System.out.println(5>>1); the result is 2 but why ?, I understand that i...
asked by 09.08.2017 / 13:13