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
Best Chunking Practices

1. Chunk by Semantic Boundaries (NOT fixed size only) Split by sections, headings, paragraphs , or logical units. Avoid cutting a sentence or concept in half. Works best with docs, tech specs, policie

 
 
 
Future State Architecture

USE CASE: LARGE RETAIL BANK – DIGITAL CHANNEL MODERNIZATION 🔹 Business Context A large retail bank wants to “modernize” its digital channels (internet banking + mobile apps). Constraints: Heavy regul

 
 
 
Prompt

1️⃣ Zero-Shot Prompt What it is: No examples, just instructions. When to use: Simple, well-defined tasks Fast responses When model already “knows” the domain Example: “Summarize this loan agreement in

 
 
 

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