The message-passing facility in Windows is called the local procedure call (LPC) facility. LPC is used for communication between two processes on the same machine. It is similar to the standard remote procedure call (RPC) mechanism that is widely used, but it is optimized for and specific to Windows. Windows uses a port object to establish and maintain a connection between two processes, like Mach. Two types of ports are used by Windows: connection ports and communication ports.The communication works as follows −Server processes publish connection-port objects that are visible to all processes.When a client wants services from a subsystem, ... Read More
WindowsThe window operating system is the extension of the disk operating system.Windows is the most popular and simplest operating system which can be used by any person who can read and understand basic English, as it does not require any special training.It requires DOS to run the various application programs initially. So, DOS should be installed into the memory and then window can be executed.LinuxLinux is one of popular version of UNIX operating System which is open source as its source code is freely available. It is free to use and wasdesigned considering UNIX compatibility. Linux’s functionality list is quite ... Read More
Operating SystemAn operating system (OS) is a collection of software that manages computer hardware resources and acts as an interface between user and hardware of the computer. It provides common services for computer programs. The OS is a crucial component of the system software in a computer system.KernelKernel is the core part of operating system and responsible for all major activities of this operating system. Kernel consists of various modules and it interacts directly with the low level hardware. It also provides the required abstraction to hide low level hardware details to system or application programs. An operating system is ... Read More
Windows anonymous pipes are actually Ordinary pipes, and they behave similarly to their UNIX counterparts: they are unidirectional and employ parent-child relationships between the communicating processes. In addition, reading and writing to the pipe can be accomplished with the ordinary ReadFile() and WriteFile() functions. The Windows API use CreatePipe() function for creating pipes, which is passed four parameters. The parameters provide separate handles forreading andwriting to the pipeAn instance of the STARTUPINFO structure, used to specify that the child process is to inherit the handles of the pipe.the size (in Bytes) of the pipe may be specified.Windows requires the programmer ... Read More
We can compare Strings in Java in various ways −Using the comapareTo() method − The compareTo() method compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argument string.Example Live Demoimport java.util.Scanner; public class StringComparison { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter string1: "); String str1 = sc.next(); System.out.println("Enter string2: "); String str2 ... Read More
Once you declare a variable final, after initializing it, you cannot modify its value further. Moreover, like instance variables, final variables will not be initialized with default values.Therefore, it is mandatory to initialize final variables once you declare them. If not a compile time error will be generated.Example Live Demopublic class FinalExample { final int j; public static void main(String args[]){ FinalExample obj = new FinalExample(); System.out.println(obj.j); } }Compile time errorFinalExample.java:5: error: non-static variable j cannot be referenced from a static context System.out.println(j); ^ 1 errorInitializing the final variableYou can initialize a ... Read More
Using copyOf() methodThe copyOf() method of the Arrays class (java.util package) accepts two parameters −an array (of any type).an integer value representing length.And copies the contents of the given array from starting position to given length and returns the new array.Example Live Demoimport java.util.Arrays; public class CopyingSectionOfArray { public static void main(String[] args) { String str[] = new String[10]; //Populating the array str[0] = "Java"; str[1] = "WebGL"; str[2] = "OpenCV"; str[3] = "OpenNLP"; str[4] = "JOGL"; ... Read More
The Boolean class of the lang package provides two method namely parseBoolean() and valueOf().parseBoolean(String s) − This method accepts a String variable and returns boolean. If the given string value is "true" (irrespective of its case) this method returns true else, if it is null or, false or, any other value it returns false.valueOf(String s) − This method accepts a String value, parses it and returns an object of the Boolean class based on the given value. You can use this method instead of the constructor. If the given String value is "true" this method returns true or, it returns ... Read More
Using the Runtime classJava provides a class named java.lang.Runtime, using this class you can interface with the current environment.The getRunTime() (static) method of this class returns a Runtime object associated with the current application.The exec() method accepts a String value representing the command to execute a process in the current environment (system) and executes it.Therefore, to execute an external application using the Runtime class −Get the run time object using the getRuntime() method.Execute the required process by passing the path of it as a String value to the exec() method.Exampleimport java.io.IOException; public class Trail { public static void main(String ... Read More
The URL class of the java.net package represents a Uniform Resource Locator which is used to point a resource (file or, directory or a reference) in the world wide web.The openStream() method of this class opens a connection to the URL represented by the current object and returns an InputStream object using which you can read data from the URL.Therefore, to read data from web page (using the URL class) −Instantiate the java.net.URL class by passing the URL of the desired web page as a parameter to its constructor.Invoke the openStream() method and retrieve the InputStream object.Instantiate the Scanner class ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP