Author: Arpit Mandliya
27 OctoberHow to fix class interface or enum expected error in java
In this post, we will see how to fix "class interface or enum expected" error in java. There can be multiple reason for getting this error. Due to method outside class body This error you will generally get when you have accidentally put your method outside class body. Let’s see with the help of simple […]
27 OctoberHow to fix illegal start of expression error in java
In this post, we will see how to fix "illegal start of expression" in java. You will get this error while using javac command in command prompt. In eclipse or any other ide, it will give you more helpful compile time error. There can be multiple reasons for getting this error. Using private, public or […]
27 OctoberCount number of words in a string
In this post, we will see how to find number of words in a String. Problem Find the number of words in a String. For example: There are 6 words in below String welcome to java tutorial on Java2blog Algorithm The algorithm will be very simple. Initialize count with 1 as if there are no […]
24 OctoberJava 8 – java.util.function.Function example
In this post, we will see about java.util.function.Function functional interface. java.util.function.Function is part of java.util.function package. There are some inbuilt functional interfaces in java.util.function which you can use if functional interface matches with your requirement. java.util.function.Function is a functional interface which takes input single argument T and returns result R. It has an abstract method as below. […]
23 OctoberAWS Certified SysOps Administrator – Associate Examination
The is intended for associates, who exhibit an administrative role in an application environment. The Certification examination tests the ability of the individual to perform deployment, management and operations on the AWS Cloud Platform Examination Overview Duration: 80 minutes of Questions: 60 Pass Score: 65% Question Type: Multiple Choice Questions Answers Type: Single/Multiple Options Correct […]
17 OctoberJava 8 Stream of example
In this post, we will see about Java 8 Stream‘s of method example. stream‘s of method is static method and used to create stream of given type. For example: [crayon-6908b4cb09462522051389/] There are two overloaded version of Stream’s of method. 1) static <T> Stream<T> of(T… values) Returns a sequential ordered stream whose elements are the specified values. […]
17 OctoberJava Stream collect to array
In this post, we will see how to collect any Java 8 Stream to array. There are many ways to do it but I am going to show easiest way. You can simply use toArray(IntFunction<A[]> generator).This generator function takes size as input and creates new array of that size. Convert Steam to Array Let’s understand […]
16 OctoberDifference between map and flatMap in java
In this post, we will see the difference between map and flatMap in java.I have already covered Stream’s map and flatMap methods in previous articles. As you might know, Stream’s map and flatMap method both can be applied on Stream<T> and return Stream<R> as output. The actual difference is, map operation produces one output value […]
15 OctoberJava 8 Stream flatMap
In this post, we will see about Java 8 Stream flatMap function.Before understanding flatMap, you should go through stream’s map function Stream‘s flatMap method takes single element from input stream and produces any number of output values and flattens result to output stream.When you apply flatMap function on each of element of the stream, it results in […]