
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
Found 9150 Articles for Object Oriented Programming

138 Views
LongToDoubleFunction is a built-in functional interface and part of java.util.function package. This functional interface accepts a long-valued parameter as input and produces a double-valued result. LongToDoubleFunction can be used as an assignment target for a lambda expression or method reference. It contains only one abstract method: applyAsDouble().Syntax@FunctionalInterface interface LongToDoubleFunction { double applyAsDouble(long value); }Example of Lambda Exampleimport java.util.function.LongToDoubleFunction; public class LongToDoubleLambdaTest { public static void main(String args[]) { LongToDoubleFunction getDouble = longVal -> { // lambda expression double doubleVal = longVal; return doubleVal; }; long input = ... Read More

216 Views
LongToIntFunction is a functional interface from java.util.function package introduced in Java 8. This functional interface accepts a long-valued parameter as input and produces an int-valued result. LongToIntFunction interface can be used as an assignment target for a lambda expression or method reference. This interface contains only one abstract method: applyAsInt() and doesn't contain any default and abstract methods.Syntax@FunctionalInterface interface LongToIntFunction { int applyAsInt(long value); }Example of Lambda Expressionimport java.util.function.LongToIntFunction; public class LongToIntLambdaTest { public static void main(String args[]) { LongToIntFunction getInt = longVal -> { // lambda expression int intVal = (int)longVal; ... Read More

469 Views
ArrayBlockingQueue stores elements in FIFO order. Insertion of element always happened at the tail of the queue and removal of the element always happened from the head of the queue. It is thread safe and It is bounded array queue therefore once created, the capacity cannot be changed. It is the implementation of the Blocking queue.As per Java Docs −Resizable-array implementation of the Deque interface. Array deques have no capacity restrictions; they grow as necessary to support usage. They are not thread-safe; in the absence of external synchronization, they do not support concurrent access by multiple threads. Null elements are ... Read More

460 Views
OAuth is designed for providing authorization of the third party without providing password. It is http based. OAuth provides an access token that can be exchanged for any supported assertion via an API.OpenId is designed for authentication. In openId third-party authenticate your users for you, by using accounts they already have. It is used to authenticate single sign-on identitySr. No.KeyOAuthOpenId1BasicOAuth is designed for providing authorization of the third party without providing passwordOpenId is designed for authentication.2SessionIt does not initiate user's session.OpenId initiate user's session3Access TokenIt used token concept to provide authorizationIn openId third-party authenticate your users for you, by using ... Read More

167 Views
IntToLongFunction is a built-in functional interface from java.util.function package. This functional interface accepts an int-valued parameter and produces a long-valued result. IntToLongFunction interface can be used as an assignment target for a lambda expression or method reference. It contains only one abstract method: applyAsLong().Syntax@FunctionalInterface interface IntToLongFunction { long applyAsLong(int value); }Example of Lambda Expressionimport java.util.function.IntToLongFunction; public class IntToLongFunctionLambdaTest { public static void main(String args[]) { IntToLongFunction getLong = intVal -> { // lambda expression long longVal = intVal; return longVal; }; int input = 40; ... Read More

215 Views
IntToDoubleFunction is a functional interface from java.util.function package. This functional interface accepts an int-valued argument and produces a double-valued result. IntToDoubleFunction can be used as an assignment target for a lambda expression or method reference. It contains only one abstract method: applyAsDouble().Syntax@FunctionalInterface interface IntToDoubleFunction { double applyAsDouble(int value); }Example of Lambda Expressionimport java.util.function.IntToDoubleFunction;; public class IntToDoubleLambdaTest { public static void main(String[] args) { IntToDoubleFunction getDouble = intVal -> { // lambda expression double doubleVal = intVal; return doubleVal; }; int input ... Read More

2K+ Views
A lambda expression is a function that expects and accepts input parameters and produces output results. It is an instance of a functional interface and also known as a single abstract method interface (SAM interface) like Runnable, Comparator, Callable and etc. We can declare a variable as a final string[] array and able to access that array index within a lambda expression.Exampleimport java.util.*; public class LambdaTest { public static void main(String args[]) { final String[] country = {null}; List cities = new ArrayList(); cities.add("Hyderabad"); cities.add("Ireland"); cities.add("Texas"); ... Read More

266 Views
DoubleToLongFunction is a built-in functional interface from java.util.function package introduced in Java 8. This functional interface accepts a double-valued parameter and produces a long-valued result. DoubleToLongFunction 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 DoubleToLongFunction { long applyAsLong(double value) }Exampleimport java.util.function.DoubleToLongFunction; public class DoubleToLongFunctionTest { public static void main(String args[]) { double dbl = 30.1212; DoubleToLongFunction castToLong = (dblValue) -> (long) dblValue; // lambda expression System.out.println(castToLong.applyAsLong(dbl)); dbl = 77.9212; DoubleToLongFunction roundToLong = Math::round; ... Read More

343 Views
DoubleToIntFunction is a functional interface defined in java.util.function package introduced in Java 8 version. This functional interface accepts a double-valued argument and produces an int-valued result. DoubleToIntFunction interface can be used as an assignment target for a lambda expression or method reference. It contains only one abstract method: applyAsInt().Syntax@FunctionalInterface interface DoubleToIntFunction { int applyAsInt(double value) }Exampleimport java.util.function.DoubleToIntFunction; public class DoubleToIntFunctionTest { public static void main(String args[]) { DoubleToIntFunction test = doubleVal -> { // lambda expression int intVal = (int) doubleVal; return intVal; }; ... Read More

254 Views
ToLongBiFunction is a in-built functional interface from java.util.function package. This functional interface accepts two reference type parameters as input and produces a long-valued result. ToLongBiFunction interface can be used as an assignment target for a lambda expression or method reference and contains only one abstract method: applyAsLong().Syntax@FunctionalInterface interface ToLongBiFunction { long applyAsLong(T t, U u); }Exampleimport java.util.*; import java.util.function.ToLongBiFunction; public class ToLongBiFunctionTest { public static void main(String[] args) { ToLongBiFunction getMobileNum = (map, value) -> { // lambda if(map != null && !map.isEmpty()) { if(map.containsKey(value)) { ... Read More