Stats

Tuesday 24 January 2017

Different methods to create THREADS in JAVA

Method 1:
By extending thread class and creating new object of child of thread and calling start() method

class Mythread extends Thread

Method 2:
By implementing Runnable interface by a class and passing it to thread class and calling start method

class Mythread2 implements Runnable {

run(){}
}

Thread t = new Thread(new Mythread2());

t.start();

Friday 20 January 2017

Java environment variables

JAVA_HOME : Set to a location of jdk folder
JRE_HOME : Set to a location of jre folder inside jdk
Add %JAVA_HOME%/bin to path variable

Java environment variables

JAVA_HOME : Set to a location of jdk folder
JRE_HOME : Set to a location of jre folder inside jdk
Add %JAVA_HOME%/bin to path variable