javac not recognized as an internal or external command

'javac' is not recognized as an internal or external command, operable program or batch file This error signifies that the PATH variable isn’t set properly.   How to fix javac not recognized error Find the correct path where you installed the JDK. it looks like this: C:\Program Files\Java\jdkxxxx\bin\ Start-menu search for “environment variable” to open […]

Difference between Thread DeadLock and LiveLock in Java

This article explains the difference between Thread DeadLock and LiveLock with examples. DeadLock DeadLock occurs when two threads are blocked for each other and each one is waiting for the other to release it’s lock. For example, Let’s consider that we have two resources A and B and two threads Thread1 and Thread2. Now, Thread1 […]

Difference between Runnable and Callable in Java

In this article, we will see difference between Runnable and Callable in Java.   Runnable and Callable both are interfaces in Java that support multithreaded programming. Both are implemented by classes that want to execute some code in a thread different than the main thread. The Runnable interface has been around since around Java 1.0 […]

Convert String to Date and Date to String in Java

In this article, we will see programs to Convert String to Date and Date to String in Java using SimpleDateFormat class.   Convert String to Date in Java We can convert or parse a String to java.util.Date using SimpleDateFormat. For example, if we want to convert a String in MM/dd/yyyy format to Date, we can […]

Java – Convert Date from one format to another

In this article, we will see Java programs to convert Date from one format to another format. Convert a java.util.Date from one format to another using SimpleDateFormat We can convert a java.util.Date from one format to another using SimpleDateFormat. For example, if we want to convert a Date to MM/dd/yyyy, we can do the same […]