top of page

Java 8 coding preparation

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Oct 3, 2023
  • 1 min read

Updated: Nov 2, 2023











-- if element is repeated , then ans will be wrong



so make use of distnce on stream 1st ,then sort it as below to get correct output


if there is onlt 1 element in array, then exception is thrown
















Function.identity return same value which we pass as below



1st approach

===


2nd approach

==


ex:

3rd approach

--




below is the data






Optional

==

We can create optional object by below methos

  1. empty()

this return optional.empty object


2.of(object)

if objct is null. then throw null pointerecxeption


3.ofNullable(obj)- if obj is null, then return optional.empty object





alays check ispresent as below


if obje is null, then it print default value as below


or you can throw exception




 
 
 

Recent Posts

See All
RFP PRE/POST-PROPOSAL SUBMISSION FLOW

🏆 1. The 5 Pillars to Win a Large Strategic Deal 1. Understand the Client Better Than They Do 👉 Don’t just read RFP — decode it What is their real problem ? What is driving this deal? (compliance, c

 
 
 
DIGITAL LENDING RFP Solution

🎯 RFP Proposal SOLUTION PRESENTATION – DIGITAL LENDING (WITH COLOR-CODED ARCHITECTURE) 1️⃣ Opening “Thank you for the opportunity. I’ll walk you through our approach to building a next-generation dig

 
 
 
Data Mesh

What Data Mesh is Why it is needed When to use it How governance is maintained Let’s structure it clearly so you can explain confidently in an interview . 1️⃣ What is Data Mesh? Data Mesh  is a decent

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page