ObjLongConsumer is a functional interface from java.util.function package. This interface accepts an object-valued and long-valued argument as input but doesn't produce any output. ObjLongConsumer can be used as an assignment target for lambda expression and method reference and contains only one abstract method: accept().Syntax@FunctionalInterface public interface ObjLongConsumer { void accept(T t, long value) }Exampleimport java.util.function.ObjLongConsumer; public class ObjLongConsumerTest { public static void main(String[] args) { ObjLongConsumer olc = (employee, number) -> { // lambda expression if(employee != null) { System.out.println("Employee Name: " + employee.getEmpName()); ... Read More
A functional interface is a special kind of interface with exactly one abstract method in which lambda expression parameters and return types are matched. It provides target types for lambda expressions and method references.Rules for a functional interfaceA functional interface must have exactly one abstract method.A functional interface has any number of default methods because they are not abstract and implementation already provided by the same.A functional interface declares an abstract method overriding one of the public methods from java.lang.Object still considered as functional interface. The reason is any implementation class to this interface can have implementation for this abstract method either from ... Read More
LongFunction is an in-built functional interface defined in java.util.function package. This functional interface expects a long-valued parameter as input and produces a result. LongFunction interface can be used as an assignment target for a lambda expression or method reference. It contains only one abstract method: apply().Syntax@FunctionalInterface public interface LongFunction { R apply(long value) }Exampleimport java.util.function.LongFunction; public class LongFunctionTest { public static void main(String[] args) { LongFunction function1 = (long i) -> { // lambda expression return i + i; }; System.out.println("Using Lambda Expression: " + function1.apply(10)); LongFunction ... Read More
A very common need for anyone who works on computers and laptops is taking screenshots of the browser or application window that they are working with. Although the task seems easy, it can be tedious at times. Generally, if you want to take a screenshot you will use the shortcut keys on your Windows system, paste it to Paint and then modify them accordingly. However, this comes with a few drawbacks:You have to use shortcut keys and paste to Paint.You can’t take screenshots of a part of screen (without cropping it in Paint later).If you are taking screenshot of a ... Read More
Risks are part of all the software projects. Risks being a very scary term is hardly considered important. A risk, can be explained as, a possibility of an event, which can result in threat, damage, injury, loss, or any other negative occurrence, that is caused by external or internal factors, and thus may be avoided through preventive actions. The risk management, hence, becomes very important to focus upon.The future is always uncertain and unclear; hence, the best way to tackle the risk is to identify them and plan for their treatment. The Risk Management process involves the complete lifecycle, starting ... Read More
A great user experience is all about enabling the end users to achieve their objective be it a website, a software system or a product. In order to fulfill their needs, we need to understand their work and the context of their work. The first and basic phase of software development life cycle is requirements gathering. They give clear, concise and agreed set of customer requirements that the software should provide. Business analyst and subject experts are responsible for requirement gathering process.Business customers have a tendency to expect software teams to be mind-readers, and to deliver a solution based on ... Read More
Fear is a common human reaction to threat that most of us have one way or the other. But what if your fear rages through you like wild fire and beyond your levels of control? Irrepressible fears can lead to mental as well as physical distress to levels which ultimately turn into anxiety disorder technically known as phobia . It can affect people of any age. In this article I discuss categories in which phobias are divided, symptoms to identify phobia, possible causes and treatment. I briefly list out some common and some exceptionally rare phobias that you did not know ... Read More
In our childhood, we used to listen to many stories from our Parents, Grandparents and also Teachers in the school. There are stories about Kings and Queens, Prince and Princes, Dogs and Monkeys etc., a wide range of stories from fictions, drama, and actions to stories with morals. One of such famous stories called as “The Sour Grapes”, where the fox jumped again and again to eat the grapes from the tree, but when he couldn’t reach to that height after many attempts, he declared that the grapes are sour.You can see the same state of affairs also occurs in ... Read More
LongBinaryOperator is a part of the functional interface from java.util.function package. This functional interface expects two parameters of type long as the input and produces a long type result. LongBinaryOperator interface can be used as an assignment target for a lambda expression or method reference. It contains only one abstract method, applyAsLong().Syntax@FunctionalInterface public interface LongBinaryOperator { long applyAsLong(long left, long right) }Example of Lambda Expressionimport java.util.function.LongBinaryOperator; public class LongBinaryOperatorTest1 { public static void main(String[] args) { LongBinaryOperator multiply = (a, b) -> { // lambda expression return a*b; }; long a = ... Read More
The E-commerce sector in our nation is booming like never before. Presently, it is occupying the third position with regards to internet users, having 10 million people who shop online. Definitely, there exists a huge potential, which is untapped to make use of.In India, Flipkart concluded its biggest online sale recently, despite few technical hiccups, they were successful in selling about 2 million items in a day for about 1.5 million people. The sales figure is quite impressive. Its fierce competitor Amazon India has also launched a mega sale later at the great Indian festival and Snapdeal is also not ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP