How to get the current working directory in Java?

Code : This will print the absolute path of the current directory from where your application was initialized. Explanation: From the documentation: java.io package resolve relative pathnames using current user directory. The current directory is represented as system property, that is, user.dir and is the directory from where the JVM was invoked.

Getting java.net.SocketTimeoutException: Connection timed out in android

I’ve searched all over the web and after reading lot of docs regarding connection timeout exception, the thing I understood is that, preventing SocketTimeoutException is beyond our limit. One way to effectively handle it is to define a connection timeout and later handle it by using a try-catch block. Hope this will help anyone in future who are facing … Read more