Data Structure
 Networking
 RDBMS
 Operating System
 Java
 MS Excel
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP
- Selected Reading
 - UPSC IAS Exams Notes
 - Developer's Best Practices
 - Questions and Answers
 - Effective Resume Writing
 - HR Interview Questions
 - Computer Glossary
 - Who is Who
 
Programming Articles - Page 1989 of 3366
 
			
			175 Views
In this article, we will be discussing the working, syntax, and example of multimap equal ‘=’ operator in C++ STL.What is Multimap in C++ STL?Multimaps are the associative containers, which are similar to map containers. It also facilitates storing the elements formed by a combination of key-value and mapped value in a specific order. In a multimap container, there can be multiple elements associated with the same key. The data is internally always sorted with the help of its associated keys.What is multimap equal to ‘=’ operator?multimap::operator= is equal to operator. This operator is used to copy the elements from ... Read More
 
			
			287 Views
In this article, we will be discussing the working, syntax, and examples of multimap::swap() function in C++ STL.What is Multimap in C++ STL?Multimaps are the associative containers, which are similar to map containers. It also facilitates storing the elements formed by a combination of key-value and mapped value in a specific order. In a multimap container, there can be multiple elements associated with the same key. The data is internally always sorted with the help of its associated keys.What is multimap::swap()?multimap::swap() function is an inbuilt function in C++ STL, which is defined in header file. swap() is used to ... Read More
 
			
			2K+ Views
In this article, we will be discussing the working, syntax, and examples of strchr() function in C++ STL.What is strchr()?strchr() function is an inbuilt function in C++ STL, which is defined in the header file. strchr() function is used to find when the character first occurred in the string. This function returns the pointer to the location where the character first appeared in the string.If the character doesn’t exist in the string the function returns the null pointer.Syntaxchar* strchr( char* str, char charac );ParametersThe function accepts the following parameter(s)−str − It is the string in which we have to ... Read More
 
			
			205 Views
JShell has introduced in Java 9 that enables us to explore, discover, and experiment with Java language features, and extensive libraries.The relational operators (==, != , =) can be used mainly for comparison. It accepts operands of non-boolean primitive data types and returns a boolean value. JShell also supports logical operators that can be used in expressions. The logical operators can expect boolean operands. The expressions involving these operands can be used for forming boolean conditions in the code within if, for, and while statements. The logical operators include : "&& : logical AND", "|| : OR" and "! : NOT".In the below two code snippets, we can ... Read More
 
			
			361 Views
A Subscription can be shared by exactly one Publisher and one Subscriber for the purpose of mediating data exchange. That is the reason subscribe() method doesn't return created Subscription, instead returns void. The Subscription is only passed to Subscriber through the onSubscribe() method callback. The Subscription interface contains two methods: request() and cancel().Syntaxpublic interface Subscription { public void request(long n); public void cancel(); }Rules for Subscription interface:Subscription.request() and Subscription.cancel() methods must be called only inside of its Subscriber context.Subscription must allow Subscriber to call the Subscription.request() method synchronously from within onNext() or onSubscribe() methods.Subscription.request() method must place an upper ... Read More
 
			
			147 Views
Any element that can be annotated with @Deprecated signifies that this particular element no longer be used for below reasonsUsing it is risky and may cause errors.May be incompatible in future versions.May be removed in future versions.A better and more efficient solution has replaced it.Java 9 has added two new elements: since and forRemoval attributes.1) since: The element specifies the deprecated version of the annotated API element.2) forRemoval: The element representing the annotated API element can be removed in a future version, and the API can be migrated.The following webpage is the documentation for a Boolean class in Java 9. The @Deprecated annotation ... Read More
 
			
			1K+ Views
Try-with-resources statement has been improved in Java 9. If we already have a resource that is final or equivalent to the final variable, then we can use that variable in a try-with-resources statement without having to declare a new variable in a try-with-resources statement.We can declare multiple resources in a try block. Try initialization block can have any number of resources resulting in either null or non-null resources.In the below example, we can able to declare multiple resources in the try-with-resources statement.Exampleimport java.io.BufferedReader; import java.io.IOException; import java.io.Reader; import java.io.StringReader; public class MultipleResourcesTest { public static void main(String args[]) throws ... Read More
 
			
			266 Views
JShell is a command-line interactive tool introduced in Java 9 version that allows the programmer to execute simple statements, expressions, variables, methods, classes, interfaces, etc.. without declaring the main() method.In JShell, the compiler warns the programmer about typecasting issues by throwing errors. However, if the programmer is aware of it, then explicit casting will be required. If we need to store a smaller data value into a larger type conversion, then implicit casting will be required.There are two kinds of integer typecasting:Literal-to-variable assignment: For instance, short s1 = 123456, the data is out of range. It is known at compile-time, and the compiler flags an ... Read More
 
			
			445 Views
Subscriber interface subscribes to publishers to receive items through onNext() method, error message through the onError() method, or a signal that no more items to be expected through the onComplete() method. Before any of those things happen, the publisher calls onSubscription() method.public interface Subscriber { public void onSubscribe(Subscription s); public void onNext(T t); public void onError(Throwable t); public void onComplete(); }Rules for Subscriber interface:A Subscriber must call through Subscription.request(long n) method to receive onNext() signals.Subscriber.onComplete() and Subscriber.onError(Throwable t) methods must not call any methods on Subscription or Publisher.Subscriber.onComplete() and Subscriber.onError(Throwable t) methods must consider the Subscription canceled after received ... Read More
 
			
			402 Views
Java 9 added ProcessHandle interface to Process API to enhance Process class. An instance of the ProcessHandle interface identifies a local process that allows us to query process status and managing processes, and ProcessHandle.Info allows us to use local code because of the need to obtain the PID of a local process.ProcessBuilder class can be used to create separate operating system processes. In the below example, we can create a process of "notepad" application by using the ProcessBuilder class.Exampleimport java.time.ZoneId; import java.util.stream.Stream; import java.util.stream.Collectors; import java.io.IOException; public class ProcessBuilderTest { public static void main(String args[]) throws IOException { ProcessBuilder pb = new ProcessBuilder("notepad.exe"); ... Read More