Create a servlet like below import javax.servlet.ServletException; import java.io.IOException; import javax.servlet.http.*; @WebServlet(urlPatterns = {"/servlet/login"}) public class NTLMAut...
Inner classes Method-local inner classes Anonymous inner classes Static nested classes Regular Inner class Regular means that the class is not static, anonymous or method-local...
Assert is used to check if a condition is as you expected it to be and if the condition is not met then the prgoram should terminate. Example public void test(int x, int y){ assert ( x &g...
I use enum when I know what instances/constants I need. It also provides compile time error check which is a plus point. Declaring enum enum TestEnum{ A, B, C }; //Use of semicol...
Watch Explanation on YouTube How to create Swap File on Linux Link URL : https://youtu.be/43Inh_045_8 Create a file and give it same space as you would to a swap partition $ sudo dd if=/dev...
String folders="E:\\folder1\\folder2\\folder3\\folder4"; String[] folder= folders.split("\\\\"); System.out.println(java.util.Arrays.toString(folder));
Java 6 and before System.getProperty("line.separator"); [Update For] Java 7 and above System.lineSeparator() BufferedWriter StringWriter stringWriter = new StringWriter(); Buffe...
$ /proc/PROCESS_ID/limits $ /proc/PROCESS_ID/fd $ /proc/PROCESS_ID/fd | wc -l
Watch How to create deadlock using static final variables on YouTube How to create deadlock using static final variables in java Link URL : https://youtu.be/p0HNCppq80A Static class initializ...