Skip to content
Newsletter
Random News
https://javaguidance.com/

Java Guidance

Java Development Made Easy

  • Angular
  • Regular Expression
  • Hibernate
  • Java 8 Stream
  • Spring Boot
  • About Us
    • Contact Us
    • Privacy Policy
  • Home
  • Interview Questions

Category: Interview Questions

  • Interview Questions
  • Java

Java Program to Check Palindrome String using stream

admin8 months ago8 months ago01 mins

In this example, we are going to learn how to find string is palindrome or not using stream. Steps to solve this problem : 1. First we will iterate string by half of its size 2. We will compare each character so here we are comparing ith element with (length-i-1)th element if all matches then…

Read More
FirstNonRepeatedCharacter
  • Interview Questions
  • Java

First Non-Repeated Character using stream in java

admin8 months ago8 months ago02 mins

  In this example, we will learn how we can find first non-repeated character using stream so first we will go oversteps how to solve this problem. Step 1: Iterate all the character from input stream Step 2: Now we will count character occurrence and will store this result into LinkedHashMap, why we have used…

Read More
  • Interview Questions
  • Java

Git: the basic commands every developer should know

admin9 months ago8 months ago03 mins

In this blog, We are going to discuss basic git commands : 1. git init This command will create a new Git repository in the current directory and it will create a `.git` folder where version control information is stored. 2. git clone <repository> This command will create a local copy of a remote repository…

Read More
Stream : Extracting Initials
  • Interview Questions

How to extract initials using stream in java?

admin2 years ago9 months ago02 mins

How to extract initials using stream in java In this Java code snippet, a list of strings named `names` is created, containing full names like “John Doe,” “Jane Smith,” and “Alice Johnson.” Using Java 8 streams, a new list called `initials` is generated by applying a transformation to each full name in the `names` list….

Read More
How to Convert temperature using stream in java
  • Interview Questions

How to Convert temperature using stream in java ?

admin2 years ago9 months ago01 mins

How to Convert temperature using stream in java In this Java code snippet, a list of double values named `celsiusTemps` is created, containing temperatures in Celsius: 0.0, 10.0, 20.0, and 30.0. Using Java 8 streams, a new list called `fahrenheitTemps` is generated by applying a conversion formula to each Celsius temperature. The `map` operation transforms…

Read More
How to check Palindrome in java using Stream API ?
  • Interview Questions

How to check Palindrome in java using Stream API ?

admin2 years ago9 months ago02 mins

How to check Palindrome in java using Stream API In this Java code snippet, a list of strings named `words` is created, containing “radar,” “hello,” and “deified.” Using Java 8 streams, a new list called `palindromes` is generated by filtering the `words` list. The `filter` operation checks if a string is a palindrome by comparing…

Read More
How to sum even numbers with Reduce in java
  • Interview Questions

How to sum even numbers with Reduce in java ?

admin2 years ago9 months ago01 mins

How to sum even numbers with Reduce in java In this Java code snippet, a list of integers named `numbers` is created with values 2, 4, 6, 8, and 10. Using Java 8 streams, the code calculates the sum of even numbers from the `numbers` list. The `filter` operation selects only even integers by checking…

Read More
How to filter strings via length using stream in java
  • Interview Questions

How to filter strings via length using stream in java ?

admin2 years ago9 months ago01 mins

How to filter strings via length using stream in java In this Java code snippet, a list of strings named `words` is created, containing “apple,” “banana,” “cherry,” and “date.” Utilizing Java 8 streams, a new list called `longWords` is generated by filtering the `words` list. The `filter` operation selects only those strings from the original…

Read More
Calculate factorial using stream in java ?
  • Interview Questions

Calculate factorial using stream in java ?

admin2 years ago9 months ago01 mins

Calculate factorial using stream in java ? In this Java code snippet, an integer variable `n` is set to 5. Using Java 8 streams, the code calculates the factorial of `n`. It does this by generating a range of integers from 1 to `n` (inclusive), and then reducing them using a multiplication operation. The `reduce`…

Read More
Stream : Summing Values in a Map
  • Interview Questions

Stream : Summing Values in a Map

admin2 years ago9 months ago01 mins

Stream : Summing Values in a Map In this Java code snippet, a `Map` called `scores` is created to store name-score pairs. Two entries are added for “Alice” with a score of 90 and “Bob” with a score of 85. The subsequent lines utilize Java 8 streams to extract the values (scores) from the `scores`…

Read More
  • 1
  • 2

Recent Posts

  • Java Program to Check Palindrome String using stream
  • First Non-Repeated Character using stream in java
  • Git: the basic commands every developer should know
  • Java 8 Stream : Map Sum values example using mapToInt
  • Java 8 Stream : FlatMap example

Recent Comments

No comments to show.

Archives

  • September 2024
  • August 2024
  • January 2024
  • August 2023
  • July 2023

Categories

  • Interview Questions
  • Java
Copyright © 2023 Java Guidance. All rights reserved.