Unit- 2 Process and Process Scheduling 2.1 Introduce Process, Program and Process Life Cycle Process Process is something that is currently under execution. So, an active program can be called a Process. Examples: ● Opening a web browser to search something on the internet — the browser becomes a process. ● Launching a music player to enjoy your favorite tunes — the music player is also a process. In computing, a process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity. Modern operating systems support multithreading , meaning a process can have multiple threads running concurrently . A Process has various attributes associated with it. Some of the attributes of a Process are: ● Process Id: Every process will be given a unique id that identifies the process...
Data Types A data type defines the kind of data a variable can store, the operations that can be performed on it, and the amount of memory allocated. Java Primitive Data Types Data Type Size Range (Approx.) Example Byte 1 byte -128 to 127 byte a = 100; short 2 bytes -32,768 to 32,767 short s = 1000; Int 4 bytes -2,147,483,648 to 2,147,483,647 int num = 50000; Long 8 bytes -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 long l = 100000L; float 4 bytes ~6–7 decimal digits float f = 5.75f; double 8 bytes ~15 decimal digits double d = 19.99; Char 2 bytes Single Unicode character char c = 'A'; boolean 1 bit* true or false boolean flag = true; *Boolean size is JVM-dependent (commonly 1 byte in memory, but logically 1 bit). Java Non-Primitive Data Types Type Description Example String Sequence of characters String name = "Dinesh"; Array Collection of elements int[] arr = {1, 2, 3}; Class Blueprint for objects class Car { } Object Instance of a class Car myCar = ...