Questions tagged as 'java'

1
answer

Difference in thread execution in Java

See the execution of two similar programs in Java. One inherits from Thread and another implements the interface Runnable : Program 1: public class PingPong extends Thread{ private String msg; private int delay; PingPong(Strin...
asked by 29.05.2016 / 15:41
3
answers

Change a date from yyyy-MM-dd to dd-mm-yyyy

I have dataTable where I display some data but the date is coming in yyyy-mm-dd format how do I change the format of this date so that I can display it correctly in my dataTable ? And where do I do this formatting? In Bean or...
asked by 14.07.2015 / 14:03
4
answers

Why different objects of the same class can access private fields from one another?

Today while I was doing a course in Udacity (Intro to Java Programming) I thought about this in the Update the class Person exercise (lesson 3 29/45). In object-oriented modeling we have the concept of encapsulation (hide implementation...
asked by 26.08.2016 / 14:09
4
answers

How to convert a string to date or date?

Here are the statements I need to convert from string to date, can you help me? ObjAl.setDataEmissao(TxtDataEmissao.getText()); ObjAl.setDataNascimento(TxtDataNascimento.getText());     
asked by 13.01.2016 / 15:20
1
answer

POST Request in Jetty Client 9.X

I'm using Jetty Client to request a API Web , until recently everything was ok, but I felt the need to send data via POST. Problem In Jetty's documentation says that POST request data should be passed by the param("chave"...
asked by 05.08.2015 / 17:30
3
answers

Method close () in try and catch blocks is required?

I'm studying Java with database and after seeing a little more about this close() method and this protected block, I was a bit confused, because in some codes and articles I see that close() was not used in try / catch blocks becau...
asked by 25.07.2018 / 15:33
4
answers

REGEX JAVA Recognize different character group

I'm breaking my head at link I'm trying to make a REGEX code that validates some .txt where it does not contain the JJ or M3 characters at the end of the line. For example: I have the 3 .txt with the lines below: .txt 1 4481; 7783...
asked by 25.10.2017 / 21:22
3
answers

Extracting numbers from a String

I have a String in the following format: 01 - 02 - 03 - 04 - 45 - 86 I need to put these numbers in array int[6] . What is the best way to do this?     
asked by 27.03.2014 / 19:31
2
answers

NFe - private and public key reading applet

I need to develop a system for issuing electronic invoices. My big problem is that this system needs to meet the A3 certificate (card) and as far as I've been reading with php it's still not possible to capture the private key and publish the ca...
asked by 07.08.2014 / 21:47
1
answer

Call PL / SQL procedure with collection of objects

Consider the following types: CREATE TYPE meu_tipo AS OBJECT ( meu_id NUMBER(6), meu_nome VARCHAR2(200) ); CREATE TYPE meu_tipo_tabela AS TABLE OF meu_tipo; And the following package: create or replace package pkg_test is...
asked by 03.12.2014 / 14:22