Category Archives: Java

Ensure Main Method Exit at the End

We can achieve this by isAlive() and join() methods of Thread class. isAlive() is not great at doing this task. So, we will be using join() method. Threadd class — implements Runnable :  class Threadd implements Runnable{Thread t;String name; Threadd(){name = “how”;t = new Thread(this,name);System.out.println(“This is thread”);t.start();} public void run() {for(int i=0;i<20;i++){System.out.println(“This is run method”);try{Thread.sleep(100);}catch(InterruptedException

Read More

HostSpot Technology in Java

Java does not support native code but there is HotSpot technology that converts few parts of java instructions (byte code) into executable code in real time by compiling it. HotSpot provides Just-in-Time (JIT) compiler for bytecode. JIT compiler compiles code as it is needed. HotSpot is the memory that is provided by JVM to run

Read More

Java brief Intro

Java is a OOP (object oriented language). Which means we see ‘who is effected’ instead of ‘what is happening’. Java was conceived by : James Gosling Patrick Naughton Chris Warth Ed Frank Mike Sheridan at Sunmicrosystems inc. in 1991. Took 18 Months for first version At the start java’s name was oak Renamed to java

Read More

Data Types and Their Size in Java

Java have two types of data types. Primitive Data Types User Defined Data Types Java is statically typed and also a strongly typed language : because we have to declare the type of each variable and one variable cannot store value of other type of variable. But languages like PHP, Python are dynamically typed because

Read More