Skip to main content

Posts

Showing posts from February, 2026

UNIT–4: DEADLOCK MANAGEMENT (OS)

Introduction to Deadlock A deadlock is a situation in an operating system where a set of processes are permanently blocked because: ·          Each process is holding at least one resource ·          Each process is waiting for another resource held by some other process As a result, none of the processes can continue execution , and the system becomes stuck. Real-Life Example: Two Cars on a Narrow Road Imagine two cars coming from opposite directions on a narrow one-lane road where only one car can pass at a time. They meet in the middle. Now: ·          Car A cannot move forward unless Car B moves back. ·          Car B cannot move forward unless Car A moves back. ·          Neither car is willing or able to move backward. So: ·      ...

Unit 5 Java Array

  Array in Java Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value. Java array  is an object which contains elements of a similar data type. Additionally, The elements of an array are stored in a contiguous memory location. It is a data structure where we store similar elements. We can store only a fixed set of elements in a Java array. declaration: An "array declaration" names the array and specifies the type of its elements . Initialisation : Initialisation is when you provide an initial value for a variable. Instantiation : Instantiation is where an object (class instance) is created . Syntax to Declare an Array in Java 1.       dataType[] arr;   2.       dataType []arr;  3.       dataType arr[];                        ...