Nettbrett, ett rett brett?
Det har vært mange diskusjoner rundt politikernes ønske om å innføre nettbrett, eller mer konkret, innføring av iPad som en del av...
Les merGet number of active thread group
Use method activeGroupCount() of ThreadGroup class to get estimate number of active groups in the thread group and use activeCount() to get...
Les merGet thread group of a thread
Use the getThreadGroup() method of Thread class to get the thread group to which the thread belongs. package...
Les merGet the state of a thread
To get the state of a thread use getState() method of a Thread class. One thing to be noted is that this method is designed for use in...
Les merUse string in switch statement
Starting from Java 7 release you can now use a string in the switch statement. On the previous version we can only use number or enum in...
Les merUse multi-catch statement
The multi-catch is a language enhancement feature introduces in the Java 7. This allow us to use a single catch block to handle multiple...
Les merRead all lines from a file
The java.nio.file.Files.readAllLines() method read all lines from a file. This method ensures that the file is closed when all bytes have...
Les merUse try-with-resources statement
The try-with-resources statement is introduced in the Java 7. With this new statement we can simplify resource management in our program,...
Les merHow to automatically close resources in JDBC
One thing that we need to do manually when programming using JDBC is to make sure to close all the resources that we use. All resources...
Les merDestroy a thread group
You can destroy a thread group by using destroy() method of ThreadGroup class. It will cleans up the thread group and removes it from the...
Les mer
Siste kommentarer