Questions tagged as 'java'

1
answer

Encrypt files in Java

I'm trying to encrypt a file and I have the following code in java, but when I run it, I'm sorry, the code is as follows: public class Prueba { public static void main(String [] args) { String comando1 = "-c"; String comando2...
asked by 21.10.2017 / 01:01
1
answer

How can I match variables in JAVA? [closed]

How is A made equal to B? Doing long "a == b" does not compile import java.util.Scanner; public class ejercicio2 { public static void main(String[] args) { Scanner teclado = new Scanner(System.in); long a;...
asked by 20.10.2017 / 13:12
1
answer

Error in java "Exception in thread" main "java.lang.NullPointerException" when compiling [duplicate]

The Exception in thread error "main" java.lang.NullPointerException locates it on line 21. Any ideas? class Factura{ private static final int MAX_ITEMS = 100; private String fecha; private String nombreCliente; private Item[] items = new It...
asked by 18.10.2017 / 15:12
2
answers

Error entering a double with period as decimal separator

If I enter it with a comma (eg 3.5), it works well. package metodosnumericos; import java.util.Scanner; public class derivada { public static void main(String[] args) { //int coeficiente, potencia,x,xc,xp; Scanner...
asked by 17.10.2017 / 01:27
2
answers

Math Class - Java

When I run the program it gives me a minimum value = 0, the maximum value does it correctly, HELP! import java.util.Scanner; import java.lang.*; class EstadisticaBasica{ private int numero; private static Scanner sc = new Scanner(Syst...
asked by 01.11.2017 / 14:10
1
answer

Sort array defined with sort (); in java

My problem arises when I order my array String nombre[5] (Whenever I consult when I have less than 5 names), because when I want to consult data I get an error: package mainclass; import java.util.Scanner; import java.util.Arrays...
asked by 02.10.2017 / 01:28
1
answer

how to convert a BufferedImage object to a byte []?

I have an object of type BufferedImage that I am filled with a screenshot using AWT BufferedImage imagexd = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())); I get the image correctl...
asked by 04.10.2017 / 19:21
1
answer

Java - Place text between list values

I am using the StrSubtitutor to create parts of a document that will be previewed in a window with ckeditor. The question is that I need to use some lists of objects for some data and must have some texts in between, explain with an example:...
asked by 05.01.2018 / 16:54
1
answer

jersey web services tags

hi I'm trying to create a web service with an eclipse jersey that receives and returns an xml, the structure of the xml should be like the following: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <root> <values>...
asked by 05.01.2018 / 18:27
1
answer

how to send an email in java web with the javax.mail.jar library

I am using jsp, servlet and classes in java to send an email from a form, it works on the PC locally using payara 4.1 and netbeans from one gmail to another but when I upload the application to a java host do not send in the mail I have the appl...
asked by 07.01.2018 / 02:01