Java OCPJP7: difference between element(), peek(), poll() and remove() methods of the Queue interface

The Queue interface defines some methods for acting on the first element of the list, which differ in the way they behave, and the result they provide. For the purposes of the OCPJP7 certification exam is important to know how these methods work and to recognize precisely how each of them behaves in some… (Read the full article)

Java OCPJP7: differenza tra i metodi element(), peek(), poll() e remove() dell’interfaccia Queue

L’interfaccia Queue definisce alcuni metodi per agire sul primo elemento della lista, che differiscono tra loro per il modo in cui si comportano e per il risultato che forniscono. Ai fini dell’esame di certificazione OCPJP7 è importante conoscere il funzionamento di questi metodi … (Read the full article)

Java OCAJP7: statement try-with-resources ed interfacce Closeable ed AutoCloseable

In Java 7 è stato introdotto lo statement try-with-resources che permette di semplificare il rilascio delle risorse da parte dello sviluppatore. Tale costrutto prevede di effettuare l’acquisizione delle risorse direttamente all’interno del try e si preoccupa di chiuderle una volta… (Read the full article)