Java

Thread class methods

In this tutorial, we will learn about Thread class methods. In the last tutorial, we already saw two thread class methods run() and start() method. There are a lot of other methods in Thread class. Check this following list. Method Description public void start() This method is used start the execution of thread. public void …

Thread class methods Read More »

Thread in Java

In this tutorial, we will learn ways to create a Thread in Java. There are two ways to create the thread in Java first one is by extending Thread class and the second one is by implementing Runnable interface. Creating a thread using Thread Class: Thread class contain constructors and methods which helps us to …

Thread in Java Read More »

Multi-Threading in Java

In this tutorial, we will learn about Multi-Threading in Java. In java we can run more than one threads(a piece of code) simultaneously at the same time with the help of Multithreading and each piece code can perform a different task. Here thread means a lightweight process which can perform some task in the program. …

Multi-Threading in Java Read More »

Comments in Java

In this tutorial, we will learn about Comments in Java. Comments are not used to perform any function in the program but they are really useful for developers. Developers can write comments with variables and Methods to remember their working (purpose) in the program. One important thing to mention comments doesn’t put any impact on …

Comments in Java Read More »

String in Java

In this tutorial, we will learn about String in Java. Some students think String is a primitive data type like int or char but In java String is a very smart and immutable class which is part of java.lang package. When we right a char sequence it represents the object of String class. Check the …

String in Java Read More »

Throw keyword in Java

In this tutorial, we will learn about throw keyword in Java. The throw keyword in java is used to throw an exception explicitly. We can throw both kinds of checked and unchecked exceptions using this throw keyword. But we mainly use throw keyword to throw custom exceptions(also known as the user-defined exceptions). Check out the …

Throw keyword in Java Read More »

Throws keyword in Java

In this tutorial, we will learn throws keyword in Java. There are many time when compiler finds some suspicious code that might throw a checked exception and warn programmers to solve exceptions. If programmer will not handle this kind of exceptions then the compiler will throw an error while compiling unreported exception XXX must be …

Throws keyword in Java Read More »

Try Catch Block

In this tutorial, we will learn about Try Catch Block in Java. Using Try Catch block is the best way to handle exceptions in Java. We keep all the code that might throw an exception in the try block. The try block is followed by the catch and finally blocks. In this catch and finally …

Try Catch Block Read More »