26 Java 8 Programs using Lambda Expression and Stream

Categories: Java 8(JDK1.8) Java Java Examples

26 Java 8 Programs using Lambda Expression and Stream

  1. Write a program to append char in char ex-input- {A, B, C} output->[A_X, B_Y, C_Z]
  2. Write a Java 8 program to calculate the age of a person in years given their birthday
  3. How to check if list is empty in Java 8 using Optional.if not null, iterate through the list and print the object
  4. Count of each character in a String using Java 8
  5. How to count the number of occurrences of a given word in a list of strings using Java 8
  6. Write a Java program To create a map from an array of strings where the key is the string and the value is its length
  7. Drop all while conditions not meet
  8. Duplicate elements with its count using Java 8
  9. How to filter and collect a list/array of strings that start with a specific letter using Java 8 Stream
  10. How to filter an array of strings by a given prefix using Java 8 Stream
  11. How to find next/previous(tomorrow/yesterday) date using Java 8?
  12. Write a Java 8 program to print the first 10 odd numbers
  13. Write a program for group words by first character of given string
  14. How to increment salary of Employee by 2%, 5% etc using java 8
  15. How to iterate and modify values in a Map using Java 8
  16. Find Last duplicate character of given string using Java 8
  17. Write a Java 8 program to get the last element of an array string/object
  18. How to print keys & values of a Map using Java 8
  19. Write a Program to find the Maximum element in an array using Java 8
  20. Find the maximum value in a list of integers using Stream & Method Reference using Java 8
  21. Write a program to find the only duplicate count list in the List using java 8
  22. How to remove all duplicates from an array of integers in Java using Java 8
  23. Given a list of integers, separate odd and even numbers
  24. How to sort a list of strings by length using Lambda expressions using Java 8
  25. Write a program to sum an array using Java 8
  26. Write a program to sum an array without using the sum method using Java 8

Java 8 Program 1:- Write a program to append char in char ex-input- {A, B, C} output->[A_X, B_Y, C_Z]

package r4r.co.in;

import java.util.List;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class AppendCharInCharExIinput {

//Write a program to append char in char ex-input- {A, B, C} output->[A_X, B_Y, C_Z]

        public static void main(String[] args) {

                Character[] input = { 'A', 'B', 'C' };

                List<String> list = Stream.of(input).map(c -> c + "_" + (char) (c + 23)).collect(Collectors.toList());

                System.out.println(list);

        }

}

Java 8 Program 2:- Write a Java 8 program to calculate the age of a person in years given their birthday

package r4r.co.in;

import java.time.LocalDate;

import java.time.Period;

import java.time.temporal.ChronoUnit;

public class CalculateAge {

        public static void main(String[] args) {

                

                //Write a Java 8 program to calculate the age of a person in years given their birthday.

                //Java-8 (java.time-package)

                LocalDate dateOfBirth = LocalDate.of(1982, 07, 21);

                LocalDate localDate = LocalDate.now();

                //Only Years

                System.out.println("Your Age[Year] - " + ChronoUnit.YEARS.between(dateOfBirth, localDate));

        // Years,Months,Days

                Period period =Period.between(dateOfBirth, localDate);

                System.out.println("Year:-"+period.getYears()+" Months:-"+period.getMonths()+" Days:-"+period.getDays());

        }

}

Java 8 Program 3:- How to check if list is empty in Java 8 using Optional.if not null iterate through the list and print the object

package r4r.co.in;

import java.util.Arrays;

import java.util.List;

import java.util.Objects;

import java.util.Optional;

public class CheckListIsEmptyOrNot {

        public static void main(String[] args) {

        //How to check if list is empty in Java 8 using Optional.if not null iterate through the list and print the object

                

    List<String> checkList=null;//Arrays.asList("Rajesh");

   

        List<String> list= Arrays.asList("Rajesh","Kumar");

     Optional.ofNullable(checkList).orElse(list).stream().filter(Objects::nonNull).forEach(System.out::println);

        }

}

Java 8 Program 4:- Count of each character in a String using Java 8

package r4r.co.in;

import java.util.HashMap;

import java.util.LinkedHashMap;

import java.util.Map;

import java.util.function.Function;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class CountEachCharacterInGivenString {

        public static void main(String[] args) {

                // Count of each character in a String using Java 8

                String str = "I am Rajesh Kumar";

                //

                Map<Object, Long> mapUsingHashMap = Stream.of(str.split("")).filter(f -> !f.isBlank()).map(s -> s.toLowerCase())

                                .collect(Collectors.groupingBy(s -> s, HashMap::new, Collectors.counting()));

                System.out.println(mapUsingHashMap);

                Map<Object, Long> mapUsingLinkedHashMap = Stream.of(str.split("")).filter(f -> !f.isBlank())

                                .map(s -> s.toLowerCase())

                                .collect(Collectors.groupingBy(s -> s, LinkedHashMap::new, Collectors.counting()));

                System.out.println(mapUsingLinkedHashMap);

                Map<Object, Long> mapUsingFuntionIdentity = Stream.of(str.split("")).filter(f -> !f.isBlank())

                                .map(s -> s.toLowerCase()).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));

                System.out.print(mapUsingFuntionIdentity);

        }

}

Java 8 Program 5:- How to count the number of occurrences of a given word in a list of strings using Java 8

package r4r.co.in;

import java.util.Arrays;

import java.util.List;

public class CountGivenWordInGivenArryOfStringUsingJava8Lamda {

        public static void main(String[] args) {

                // How to count the number of occurrences of a given word in a list of strings using Java 8

                String[] input = { "Rajesh Kumar r4r", "Rajesh r4r Kumar r4r Rajesh", "r4r r4r" ,"Rajesh Kumar"};

                List<String> list = Arrays.asList(input);

                //List<String> list=Arrays.asList("Rajesh Kumar r4r", "Rajesh r4r Kumar r4r Rajesh", "r4r r4r" ,"Rajesh Kumar");

                String str = "r4r";

                long count = list.stream().flatMap(f->Arrays.stream(f.split(" "))).filter(w -> w.equals(str)).count();

                System.out.print(count);

        }

}

Java 8 Program 6:- Write a Java program To create a map from an array of strings where the key is the string and the value is its length

package r4r.co.in;

import java.util.Map;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class CreateMapStringAsKeyAndLengthAsValue {

        public static void main(String[] args) {

//Write a Java program To create an map from a array of strings where the key is the string and the value is its length

                String[] str= {"Rajesh","Kumar"};

                Map<String, Integer> map=Stream.of(str).collect(Collectors.toMap(s->s, String::length));

                System.out.print(map);

        }

}

Java 8 Program 7:- Drop all while condition not meet

package r4r.co.in;

import java.util.List;

import java.util.Set;

import java.util.stream.Collectors;

public class DropWhileExamples {

//Drop all while condition not meet

        public static void main(String[] args) {

                // Unordered stream- non-deterministic

                Set<Long> set=Set.of(1L, 5L, 7L, 10L, 11L, 12L).stream().dropWhile(value -> value % 2 != 0).collect(Collectors.toSet());

                System.out.println(set);

                

                // Order stream

                List<Long> list=List.of(1L, 5L, 7L, 10L, 11L, 12L).stream().dropWhile(value -> value % 2 != 0).collect(Collectors.toList());

                System.out.println(list);

        }

}

Java 8 Program 8:- Duplicate elements with its count using Java 8

package r4r.co.in;

import java.util.Arrays;

import java.util.Collections;

import java.util.List;

import java.util.Map;

import java.util.function.Function;

import java.util.stream.Collectors;

public class DuplicateElementsWithItsCount {

        public static void main(String[] args) {

                // Duplicate elements with its count using Java 8

                List<String> list = Arrays.asList("1", "2", "3", "1", "2", "4");

                

                // First Approach

                Map<String, Long> map = list.stream().filter(s -> Collections.frequency(list, s) > 1)

                                .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));

                System.err.println(map);

                

                // Second Approach

                Map<String, Long> smap = list.stream()

                                .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream()

                                .filter(entry -> entry.getValue() > 1)

                                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

                System.out.println(smap);

        }

}

Java 8 Program 9:- How to filter and collect a list/array of strings that start with a specific letter using Java 8 Stream

package r4r.co.in;

import java.util.List;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class FilterBySpecificCharcter {

        public static void main(String[] args) {

//How to filter and collect a list/array of strings that start with a specific letter using Java 8 Stream

                String[] input = { "Rajesh", "Rahul", "Verma", "Patel","R4R","r4r r4r" };

                List<String> list = Stream.of(input).filter(f -> f.startsWith("R")).collect(Collectors.toList());

                System.out.print(list);

        }

}

Java 8 Program 10:- How to filter an array of strings by a given prefix using Java 8 Stream

package r4r.co.in;

import java.util.Arrays;

import java.util.stream.Stream;

public class FilterWithGivenPrefix {

        public static void main(String[] args) {

        // How to filter an array of strings by a given prefix using Java 8 Stream

        String[] str={"Rajesh","Kumar","R4R"};

        String prefix="R";

        String[] filteredStr=Stream.of(str).filter(s->s.startsWith(prefix)).toArray(String[]::new);

        System.out.print(Arrays.toString(filteredStr));

        }

}

Java 8 Program 11:- How to find next/previous(tomorrow/yesterday) date using Java 8 ?

package r4r.co.in;

import java.time.LocalDate;

public class FindTodayTommrowYesterdayUsingJava8 {

        public static void main(String[] args) {

                //How to find next/previous(tomorrow/yesterday) date using Java 8?

                LocalDate date = LocalDate.now();

                System.out.println("Today     :- " + date);

                System.out.println("Yesterday :- " + date.minusDays(1));

                System.out.println("Tommorrow :- " + date.plusDays(1));

        }

}

Java 8 Program 12:- Write a Java 8 program to print the first 10 odd numbers.

package r4r.co.in;

import java.util.List;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class First10thOdd {

//Write a Java 8 program to print the first 10 odd numbers

        public static void main(String[] args) {

                List<Integer> list=Stream.iterate(0,i->i+1).filter(f->f%2==0).limit(10).collect(Collectors.toList());

                System.out.println(list);

                

                List<Integer> integers=Stream.iterate(0, i->i+2).limit(10).collect(Collectors.toList());

                System.out.println(integers);

        }

}

Java 8 Program 13:- Write a program for group words by first character of given string.

package r4r.co.in;

import java.util.List;

import java.util.Map;

import java.util.stream.Collectors;

import java.util.stream.Stream;

//Write a program for group words by first character of given string

public class GroupByFirstChacterGivenSring {

        public static void main(String[] args) {

                String str = "Rajesh Kumar Verma R4r";

                Map<Character, List<String>> map = Stream.of(str.split("\s")).

                                collect(Collectors.groupingBy(s -> s.charAt(0)));

                System.out.print(map);

        }

}

Java 8 Program 14:- How to increment salary of Employee by 2%, 5% etc using java 8

package r4r.co.in;

import java.util.List;

import java.util.stream.Collectors;

public class IncrementSalary {

        public static void main(String[] args) {

                // How to increment salary of Employee by 2%, 5% etc using java 8

                List<EmployeeSalary> list = List.of(new EmployeeSalary(1, "Rakesh Kumar", 32, "JUNIOR", 1100),

                                new EmployeeSalary(2, "Rajesh Kumar", 30, "JUNIOR", 2100),

                                new EmployeeSalary(3, "Bimal Kumar Patel", 25, "JUNIOR", 1500),

                                new EmployeeSalary(4, "Brijesh Kumar Patel", 35, "JUNIOR", 1600));

                System.out.println("Input List" + list);

                

                //Salary increase by 2

                System.out.println("Salary increase by 2 List");

                List<EmployeeSalary> employeeSalaries=list.stream().

                                map(f->new EmployeeSalary(f.getId(), f.getName(), f.getAge(), f.getType(), f.getSalary()+(f.getSalary()*.02))).collect(Collectors.toList());

                System.out.println(employeeSalaries);

                

                // Salary increase by 5

                System.out.println("Salary increase by 5 List");

                List<EmployeeSalary> employeeSalaries1=list.stream().map(f->new EmployeeSalary(f.getId(), f.getName(), f.getAge(), f.getType(), f.getSalary()+(f.getSalary()*.05))).collect(Collectors.toList());

                System.out.println(employeeSalaries1);

                

                

        }

}

class EmployeeSalary {

        int id;

        String name;

        int age;

        String type;

        double salary;

        public EmployeeSalary(int id, String name, int age, String type, double salary) {

                this.id = id;

                this.name = name;

                this.age = age;

                this.type = type;

                this.salary = salary;

        }

        public int getId() {

                return id;

        }

        public void setId(int id) {

                this.id = id;

        }

        public String getName() {

                return name;

        }

        public void setName(String name) {

                this.name = name;

        }

        public int getAge() {

                return age;

        }

        public void setAge(int age) {

                this.age = age;

        }

        public String getType() {

                return type;

        }

        public void setType(String type) {

                this.type = type;

        }

        public double getSalary() {

                return salary;

        }

        public void setSalary(double salary) {

                this.salary = salary;

        }

        @Override

        public String toString() {

                return "Employee [id=" + id + ", name=" + name + ", type=" + type + ", age=" + age + ", salary=" + salary + "]";

        }

}

Java 8 Program 15:- How to iterate and modify values in a Map using Java 8

package r4r.co.in;

import java.util.HashMap;

import java.util.Map;

public class IterateAndmodifyValuesInMapUsingJava8 {

        public static void main(String[] args) {

                // How to iterate and modify values in a Map using Java 8

                Map<String, String> map = new HashMap<String, String>();

                map.put("1", "1");

                map.put("2", "2");

                map.put("3", "3");

                map.put("4", "4");

                map.put("5", "5");

                map.put("6", "6");

                System.out.println(map);

                map.computeIfPresent("1", (key, value) -> "11");

                map.computeIfAbsent("7", (value) -> "7");

                

                System.out.println("Modified Map......");

                map.entrySet().forEach(System.out::println);

                //or

                //map.entrySet().iterator().forEachRemaining(System.out::println);

        }

}

Java 8 Program 16:- Find Last duplicate character of given string using Java 8

package r4r.co.in;

import java.util.Map;

import java.util.function.Function;

import java.util.stream.Collectors;

public class LastDuplicateCharacter {

        public static void main(String[] args) {

                

        // Find Last duplicate character of given string using Java 8

                String str = "Rajesh Kumar is Java Lead";

                Map<Character, Long> mapGroupByCharacters = str.chars().mapToObj(c -> (char) c).map(c->c.toLowerCase(c)).filter(f -> f != ' ')

                                .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));

                System.out.println(mapGroupByCharacters);

                Map<Character, Long> mapOfduplicateChacters = mapGroupByCharacters.entrySet().stream()

                                .filter(f -> f.getValue() > 1).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

                System.out.println(mapOfduplicateChacters);

                

                Map<Character, Long> lastElement = mapOfduplicateChacters.entrySet().stream()

                                .skip(mapOfduplicateChacters.size() - 1)

                                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

                

                System.out.println(lastElement);

        }

}

Java 8 Program 17:- Write a Java 8 program to get the last element of an array string/object

package r4r.co.in;

import java.util.stream.Stream;

public class LastElementOfAnArray {

        public static void main(String[] args) {

                //Write a Java 8 program to get the last element of an array string/object

                String[] input = { "Rajesh", "Kumar", "Verma", "R4R" };

                String lastElement = Stream.of(input).skip(input.length - 1).findAny().get();

                System.out.println(lastElement);

        }

}

Java 8 Program 18:- How to print keys & values of a Map using Java 8.

package r4r.co.in;

import java.util.HashMap;

import java.util.Map;

import java.util.stream.Stream;

public class MapExamplesJava8 {

        public static void main(String[] args) {

                // How to print keys & values of a Map using Java 8

                

                Map<String,String> map= new HashMap<String, String>();

                map.put("Key-1","value-1");

                map.put("Key-2","value-2");

                map.put("Key-3","value-3");

                map.put("Key-4","value-4");

                //using forEachRemaining

                //Using Java 8 – Collection.iterator() and Iterator.forEachRemaining()

                map.entrySet().iterator().forEachRemaining(System.out::print);

                //all values

                System.out.println("\n---------------------");

                map.values().forEach(System.out::print);

                System.out.println("\n---------------------");

                 //Using Java 8 – Collection.stream() and Stream.forEach()

                map.entrySet().stream().forEach(System.out::print);

                System.out.println("\n---------------------");

                //Stream -keys and values.

                Stream.of(map).map(m->m.keySet()).forEach(System.out::print);

                System.out.println("\n---------------------");

                Stream.of(map).map(m->m.values()).forEach(System.out::print);

                System.out.println("\n---------------------");

                 //Using Java 8 – Stream.of() + Collection.toArray() + Stream.forEach()

                Stream.of(map.entrySet().toArray()).forEach(System.out::print);

                System.out.println("\n---------------------");

                //Using Java 8 - Stream.of() and  Collection.toString() and Stream.forEach()

                Stream.of(map.entrySet().toString()).forEach(System.out::print);

        }

}

Java 8 Program 19:- Write a Program to find the Maximum element in an array using Java 8.

package r4r.co.in;

import java.util.Arrays;

import java.util.Comparator;

public class MaximumOfGivenArray {

        public static void main(String[] args) {

                //Write a Program to find the Maximum element in an array using Java 8

                

                int[] arr= {1,2,3,4,5,66,6,7,7,4,8};

                int max=Arrays.stream(arr).max().getAsInt();

                System.out.println(max);

                

                Integer[] arrInteger= {2,3,45,56,67,27,76,83,28,228,338,4343};

                Integer maxValue=Arrays.stream(arrInteger).max(Comparator.naturalOrder()).get();

                System.out.println(maxValue);

        }

}

Java 8 Program 20:-  Find the maximum value in a list of integers using Stream & Method Reference using Java 8.

package r4r.co.in;

import java.util.Arrays;

import java.util.List;

import java.util.Optional;

import java.util.stream.Stream;

public class MaxUsingMethodReferencing {

        static Optional<Integer> maxValue(Stream<Integer> s) {

                Optional<Integer> max=s.max(Integer::compare);

                return max;

        }

        

        public static void main(String[] args) {

                //Find the maximum value in a list of integers using Stream & Method Reference

                

                List<Integer> list=Arrays.asList(1,3,4,5,6,7,77,8,8,9);

                int max=maxValue(list.stream()).orElse(-1);

                System.out.println(max);

        }

}

Java 8 Program 21:- Write a program to find the only duplicate count list in the List using java 8.

package r4r.co.in;

import java.util.Collections;

import java.util.List;

import java.util.Map;

import java.util.function.Function;

import java.util.stream.Collectors;

public class OnlyDuplicateCountList {

        public static void main(String[] args) {

                // Write a program to find the only duplicate count list in the List

                List<String> list = List.of("Rajesh", "Kumar", "Verma", "Verma", "Rani", "Prisha", "Prisha", "Verma", "Rani");

                Map<String, Long> map = list.stream().filter(d -> Collections.frequency(list, d) > 1)

                                .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));

                System.out.println(map);

        }

}

Java 8 Program 22:- How to remove all duplicates from an array of integers in Java using Java 8.

package r4r.co.in;

import java.util.Arrays;

import java.util.stream.Stream;

public class RemoveAllDuplicateInteger {

        public static void main(String[] args) {

        //How to remove all duplicates from an array of integers in Java using Java 8

                Integer [] input= {1,2,3,6,1,9,3,7,3,7,8,3,4,5,6};

                Integer[] output=Stream.of(input).distinct().toArray(Integer[]::new);

                System.out.print(Arrays.toString(output));

         }

}

Java 8 Program 23:- Given a list of integers, separate odd and even numbers.

package r4r.co.in;

import java.util.Arrays;

import java.util.List;

import java.util.Map;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class SeparateOddAndEvenNumbers {

        public static void main(String[] args) {

//Given a list of integers, separate odd and even numbers

                Integer[] input= {1,2,3,4,5,6,7,8,9,10};

                //Stream.of(input)-stream

                List<Integer> list=Arrays.asList(input);

                Map<Boolean, List<Integer>> oddEvenMap=list.stream().collect(Collectors.partitioningBy(s->s%2==0));

                System.out.println(oddEvenMap);

                for (Map.Entry<Boolean,List<Integer>> entry:oddEvenMap.entrySet()) {

                        List<Integer> values=entry.getValue();

                        Boolean key=entry.getKey();

                        if(key)

                                System.out.println("Even");

                        else

                                System.out.println("Odd");

                        System.out.println(values);

                                

                }

        }

}

Java 8 Program 24 :- How to sort a list of strings by length using Lambda expressions using Java 8.

package r4r.co.in;

import java.util.List;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class ShortByLengthOfString {

        public static void main(String[] args) {

                // How to sort a list of strings by length using Lambda expressions using Java 8

                String[] str = { "Rajesh Kumar", "Rajesh", "Kumar", "R4R" ,"Rajesh r4r"};

                List<String> list = Stream.of(str).sorted((o1, o2) -> (o1.length() - o2.length())).collect(Collectors.toList());

                System.out.print(list);

        }

}

Java 8 Program 25:- Write a program to sum an array using Java 8

package r4r.co.in;

import java.util.stream.Collectors;

import java.util.stream.Stream;

public class SumAnArray {

//Write a program to sum an array using Java 8

        public static void main(String[] args) {

  Integer[] input= {1,2,3,4,5,6,7,8,9,10};

  int sum=Stream.of(input).collect(Collectors.summingInt(Integer::intValue));

 

  System.err.println(sum);

        }

}

Java 8 Program 26:- Write a program to sum an array without using the sum method using Java 8.

package r4r.co.in;

import java.util.stream.Stream;

public class SumWithoutUsingSumMenthod {

        public static void main(String[] args) {

                //Write a program to sum an array without using the sum method using Java 8

                Integer[] input= {1,2,34,5,6,7,8,78,9,99,9,5,97,96,79};

                Integer sum=Stream.of(input).reduce(0, (x,y)->x+y).intValue();

                System.out.print(sum);                

        }

}

Top Blogs
Java Retention Policy, SOURCE,CLASS,RUNTIME Published at:- Meaning Of Java Published at:- Java Programming in Python Published at:- Applications of Java Programming Published at:- Java Explaination Published at:- History of Java Published at:- Tools You Will Need Published at:- Local Environment Setup Published at:- Popular Java Editors Published at:- Basic Syntax in Java Published at:- Java Identifiers Published at:- Java Modifiers Published at:- Inheritance Published at:- Object and Classes In Java Published at:- Classes in Java Published at:- Source File Declaration Rules Published at:- Java Package Published at:- Constructors Published at:- No argument Constructors Published at:- Basic Datatypes In Java Published at:- Java - Modifier Types Published at:- Java - Basic Operators Published at:- The Relational Operators Published at:- The Bitwise Operators Published at:- The Logical Operators Published at:- The Assignment Operators Published at:- Miscellaneous Operators Published at:- Precedence of Java Operators Published at:- Java - Loop Control Published at:- Java - Decision Making Published at:- Java - Numbers Class Published at:- Java In Character Class Published at:- Escape Sequences In Java Published at:- Character Methods In Java Published at:- Java In Strings Class Published at:- String Length In Java Published at:- Concatenating Strings In Java Published at:- Creating Format Strings In Java Published at:- Java - Arrays Published at:- Creating Arrays In Java Published at:- Java - Date and Time Published at:- Getting Current Date and Time Published at:- Date Comparison Published at:- Simple DateFormat Format Codes Published at:- Sleeping for a While Published at:- Gregorian Calendar Class Published at:- Java - Regular Expressions Published at:- Java - Methods Published at:- Method Calling Published at:- Passing Parameters by Value In Java Published at:- Method Overloading In Java Published at:- The finalize( ) Method In Java Published at:- Java - Files and I O Published at:- Standard Streams In Java Published at:- File Input Stream Published at:- File Output Stream In Java Published at:- Directories in Java Published at:- Java - Exceptions Published at:- Exception Hierarchy In Java Published at:- Java Programming Language Published at:- JDK in Java Published at:- History of Java Programming Language Published at:- Difference Between C++ vs Java vs Python Published at:- How JVM Works – JVM Architecture? Published at:- JVM Memory Published at:- Difference between Byte Code and Machine Code Published at:- How is Java platform independent? Published at:- Java is platform-independent but JVM is platform dependent Published at:- Java Basic Syntax Published at:- Data types in Java Published at:- Primitive data type vs. Object data type in Java with Examples Published at:- Java Identifiers Published at:- Operators in Java Published at:- Variables in Java Published at:- Types of Variables in Java Published at:- Differences between the Instance variable Vs. the Static variables Published at:- Scope of Variables In Java Published at:- Differences between JDK, JRE and JVM Published at:- Similarities and Difference between Java and C++ Published at:- Setting up the environment in Java Published at:- Packages In Java Published at:- Decision Making in Java (if, if-else, switch, break, continue, jump) Published at:- Loops in Java Published at:- Java while loop with Examples Published at:- Java do-while loop with Examples Published at:- Components of do-while Loop Published at:- Continue Statement in Java Published at:- Break statement in Java Published at:- Define Java Methods Published at:- Java Method Parameters Published at:- Return Values In JAva Published at:- Define of Java Scope Published at:- Meaning of Java Recursion Published at:- What is OOP in Java ? Published at:- Java Class Attributes Published at:- Java Class Methods Published at:- Static vs. Non-Static Java Published at:- Java Constructors Published at:- Java Encapsulation Published at:- Java Packages Published at:- Java Inheritance Published at:- Java Polymorphism Published at:- Java - Abstraction Published at:- Java - Interfaces Published at:- Declaring Interfaces In Java Published at:- Java - Overriding Published at:- Java - Packages Published at:- Java - Data Structures Published at:- Java - Data Structures Published at:- The Collection Interfaces In Java Published at:- Generics In Java Published at:- Java - Serialization Published at:- Java - Networking Published at:- Java - Sending Email Published at:- Java - Multithreading Published at:- Java - Applet Basics Published at:- Java - Documentation Comments Published at:- Comments in Java Published at:- Java Interview Questions Set 1 Published at:- Java Interview Questions Set 2 Published at:- Java Interview Questions Set 2 Published at:- Java Interview Questions Set 3 Published at:- Java Interview Questions Set 4 Published at:- Java Interview Questions Set 5 Published at:- Java Interview Questions Set 6 Published at:- Java Interview Questions Set 7 Published at:- Java Interview Questions Set 8 Published at:- Java Interview Questions Set 9 Published at:- Java Interview Question Set 10 Published at:- Java Interview Question Set 11 Published at:- Java interview Question Set 12 Published at:- Java Interview Question Set 13 Published at:- Java Interview Questions Set 10 Published at:- Java Interview Question Set 12 Published at:- Java Interview Question Set 13 Published at:- Java Interview Question Set 14 Published at:- Java Interview Question Set 15 Published at:- Java Multithreading Interview Questions Set 1 Published at:- Java multithreading interview questions Set 2 Published at:- Java multithreading interview questions Set 3 Published at:- Java Multithreading Interview Set 4 Published at:- Java multithreading interview questions Set 5 Published at:- Java collections interview questions Set 6 Published at:- Java collections interview questions Set 7 Published at:- Java Interview Question Set 8 Published at:- Java Interview Question Set 1 Published at:- Java Interview Question Set 10 Published at:- Java Interview Question Published at:- Java Interview Question Published at:- Java Interview Question Published at:- Java Interview Question Published at:- Java Interview Question Published at:- Java Interview Question Published at:- Java Interview Question Published at:- JavaScript Interview Questions Published at:- Javascript Interview Question Published at:- Javascript Interview Question Published at:- JavaScript Interview Question Set 1 Published at:- JavaScript Interview Question Set 2 Published at:- JavaScript Interview Question Set 3 Published at:- JavaScript Interview Question Set 4 Published at:- Python Interview Question Set 6 Published at:- How to Optimize Java Apps on Kubernetes Published at:- When and Why Java is utilized for Application Improvement Published at:- Scanner nextLine() ,nextInt() ,nextDouble() method in Java with Examples Published at:- java toUpperCase() and toLowerCase() example Published at:- pushing value at last in java | how to add element at the end of array in java Published at:- Write a program for group words by first character of given string | Java 8 Stream Example Published at:- Write a Java 8 program to calculate the age of a person in years given their birthday Published at:- Write a Java 8 program to calculate the age of a person in years given their birthday Years Months Days Published at:- Write a Java 8 program to print the first 10 odd numbers Published at:- Filter employees by age in Java 8 Lamda steam Published at:- Write a Java 8 program to get the last element of an array string/object Published at:- Filter employees by age set senior if age is greater than 30 in Java 8 Lamda steam Published at:- How to increment salary by 2%, 5%, etc. Using java Published at:- Write a program to find the only duplicate count list in the List Published at:- Write a program to append char in char ex-input- {A, B, C} output->[A_X, B_Y, C_Z] Published at:- Write a program to sum an array without using the sum method Published at:- Write a program to sum an array Published at:- Drop all while condition not meet dropWhile(),dropWhile(Predicate<T> predicate) Published at:- Find the maximum value in a list of integers using Stream & Method Reference Published at:- How to sort a list of strings by length using Lambda expressions Published at:- How to filter and collect a list of strings that start with a specific letter using Java 8 Stream Published at:- Write a Java program To create a map from a array of strings where the key is the string and the value is its length Published at:- How to count the number of occurrences of a given word in a list of strings using Java 8 Published at:- How to remove all duplicates from an array of integers in Java using Java 8 Published at:- How to find next, previous, tomorrow ,yesterday date using Java 8 Published at:- How to iterate and modify values in a Map using Java 8 Published at:- How to print keys & values of a Map using Java 8 Published at:- count of each character in a String using Java 8 Published at:- Write a Program to find the Maximum element in an array Published at:- How to check if list is empty in Java 8 using Optional Published at:- Find duplicate elements with its count using Java 8 Published at:- Find Last duplicate character of given string using Java 8 Published at:- Given a list of integers, separate odd and even numbers Published at:- java 8 using lambda expression and stream api | Java 8 Programs using Lambda Expression and Stream Published at:- 26 Java 8 Programs using Lambda Expression and Stream Published at:- Java 8 Stream String Null Or Empty Filter Published at:- sum ,min ,max etc example using reduce method using Java 8 Stream API Published at:-
R4R.co.in Team
The content on R4R is created by expert teams.