The Consumer Functional interface takes a single input and does not return anything. The consumer interface is located in java.util.function package. It has a Single Abstract Method (SAM) accept(), which accepts the generic object type T and doesn't return any result. … [Read more...]
Java Function Example – Functional Interface
The Function Functional interface takes a single input and returns any value. The function interface is located in java.util.function package. It has a Single Abstract Method (SAM) apply(), which accepts the generic object type T and returns object type R. … [Read more...]
Java Predicate Example – Functional Interface
The Predicate Functional interface takes a single input and returns a boolean value. The predicate interface is located in java.util.function package. It has a Single Abstract Method (SAM) test(), which accepts the generic object type T and returns a boolean. … [Read more...]
Java Method Reference – Static, Instance, Arbitrary Object & Constructor Reference
In this article, we will look at Java method reference and its types - Static method reference, Instance method reference, Arbitrary object reference, and Constructor Reference. The method reference is nothing but the simplified version of the lambda expression. Instead of providing an implementation body, a method reference refers to an existing available method. … [Read more...]
Python Split String [ Delimiter, Space, Character, Regex, Multiple Delimiters ]
Splitting a String into separate words is one of the most common operations performed on a String. We can use the split() method of the str class to perform the split operation. In this Python Split String article, we will learn how to split string in Python based on a delimiter, comma, space, character, regex, and multiple delimiters. … [Read more...]
Python String to Int Conversion & Vice-Versa [ Int to String ]
In this tutorial, we will learn how to convert Python String to Int and vice-versa (Python Int to String). We will also explore the how-to convert String into an int with different bases and the possible conversion errors. … [Read more...]
Python Strings Basics and String Operations
Python String is one of the most popular data types in Python. A string is a sequence of characters such as names, special characters, or numbers to display. In this article, we will learn about the Python Strings Basics and some String Operations. … [Read more...]
Java Functional Interface – @FunctionalInterface Annotation
The Functional Interface is introduced in Java 8, and it is nothing but an interface with a Single Abstract Method (SAM). A functional interface can act as a target for a lambda expression or a method reference. … [Read more...]
Spring Dependency Injection [Inversion of Control]
Dependency Injection(DI) is the most important feature of Spring Framework. Dependency Injection is a design pattern that removes the dependency between objects so that the objects are loosely coupled. In Spring there exist two major types of Dependency Injection. Setter Injection Constructor Injection … [Read more...]
Prime Number Program in Python with Optimization [Sieve of Eratosthenes & 6n+1 / 6n-1 ]
What is a Prime Number? A Prime Number is a number which is greater than 1 and divisible by 1 and only itself. Some of the Prime Numbers are 2, 3, 5, 7, 11, 13, 17... In this article, let's create a Prime Number Program in Python and learn some Optimization techniques. … [Read more...]
Python Keywords and Identifiers
In this article, let's learn about Python Keywords and Identifiers. Keywords in Python are the reserved words and cannot be used as variable names, function names, or class names, etc. Python Identifiers are nothing but the name which we give to identify a variable, function, object, etc. … [Read more...]
Python Sieve of Eratosthenes
In this article, we will learn how to implement Python Sieve of Eratosthenes to find Prime Numbers. Sieve of Eratosthenes is an ancient algorithm used to find the prime numbers up to any given limit and it is one of the efficient ways to find prime numbers. … [Read more...]
- 1
- 2
- 3
- …
- 30
- Next Page »