Multithreading in Java

Multithreading is a specialized form of multitasking. It is responsible for executing more than one task at a time of a single program, and each task is a separate thread. A program that is multithreaded consists of two or more parts that …

Read moreMultithreading in Java

Deadlock in Java

Multithreading has the concept of Deadlock. The first thread waits for a lock, and a second thread occupies that lock. The second thread is waiting for an object lock that is occupied by a previous(first) thread. It leads to deadlock …

Read moreDeadlock in Java

Java Thread class

Thread class The thread represents a part of the process. Every process can have multiple associated threads in which every thread may execute the same or different job. By default, each thread assigns a default priority by the JVM, which …

Read moreJava Thread class

Thread Scheduler in java

Scheduling: it is defined as the execution of multiple threads on a single CPU in some order is called scheduling. Preemptive-priority scheduling: This algorithm schedules threads based on their priority relative to other Runnable threads.  At any time when multiple …

Read moreThread Scheduler in java

Java Thread Creation

Java provides the two ways to create a Thread: Implementing the Runnable interface. Extending the Thread class. Implementing Runnable interface The easiest way of creating a thread is to make a class that implements the Runnable interface. The runnable interface …

Read moreJava Thread Creation

Basic Terms in Multithreading

To understand the terms of multithreading, we must have knowledge about concurrency, processes, and threads. Concurrency The concurrency stands for performing multiple tasks at the same time. In the process communication, the operating system permits the process to communicate with …

Read moreBasic Terms in Multithreading

Process and Thread in Java

Process It is a program that is running on your computer. The process is a heavy-weight, which takes memory separately to other processes. The process may be a small background task like spell-checker; it may be internet explorer or Microsoft …

Read moreProcess and Thread in Java

URLConnection Class

What is the URL? URL stands for Uniform Resource Locator, is used to specify addresses on the World Wide Web. A URL relates to the identification of any resource connected to the web. URL syntax:

The protocol indicates how …

Read moreURLConnection Class

Java Socket Programming

Java Socket Programming Socket programming is used for the communication between the applications, i.e., client and server running on different JRE may be connection-oriented or connectionless. The client program can be designed using the Socket class. The server program can …

Read moreJava Socket Programming

Java Networking

Networking Networking is a way of communicating the devices. It is made up of various technologies like computers, switches, routers that are interconnected and share data among themselves. The two common network protocols: 1. TCP/IP TCP stands for Transmission Control …

Read moreJava Networking

Java InetAddress class

InetAddress class The InetAddress class refers to the IP address, both IPv4 and IPv6.An instance of an InetAddress consists of an IP address and possibly its corresponding hostname. It provides a method to get the IP address of the hostname …

Read moreJava InetAddress class

HttpURLConnection

HttpURLConnection Protocol It is a standard set of rules that allow electronic devices to communicate with each other. The http protocol The http protocol is for data communication, distributing, collaborating, hypermedia information systems, on the World Wide Web. The http …

Read moreHttpURLConnection

Java Hello World

Let’s start by writing a simple program that prints “Hello World” to the output window. Write the program into any text editor or IDE (Eclipse, Netbeans, etc.) and save the file with the .java extension. You can compile the file …

Read moreJava Hello World

JDK | Java Development Kit

Java Development Kit (JDK) The Java Development Kit is a software development environment used to create Java applications. The JDK includes JRE (Java Runtime Environment), an interpreter (java), a compiler (javac), an archiver, a documentation generator, and other tools needed …

Read moreJDK | Java Development Kit