Text Block and String Template in Java 21

preview_player
Показать описание
Check out our courses:

Coupon: TELUSKO10 (10% Discount)

For More Queries WhatsApp or Call on : +919008963671

More Learning :

Donation:
PayPal Id : navinreddy20
Рекомендации по теме
Комментарии
Автор

The best thing about Navin sir is, he does the mistake and then tells us the correct way. This is a fine way of teaching.

suraj.mohapatra
Автор

Another great thing with templates is that you can directly create for example sql statements or json objects without having an actually string anywhere.
For example:
PreparedStatement ps = SQL."SELECT * FROM database";

redcrafterlppa
Автор

The string template looks confusing tbh, you have to put STR. and also the \ before variables, idk if I like the syntax

luigicorvino
Автор

Sir when you will show to us the "Hello World Program without static main method and unnamed class" ?

neerajslab
Автор

Can we use this feature in jdk 17 by any way?

aditeepoddar
Автор

You wrote two semicolons at the end of the String declaration statement.

saibabuinukonda
Автор

Java is releasing lot of features with every release, but problem is with adoption, legacy code wont upgrade and spring boot will not upgrade to latest java versions, if we use plain java with all dependencies, theyre not compatible with latest java.

masalanuts
Автор

make a video on jdk 21 new main method

shantohossain
Автор

In my opinion Java is trying to copy Kotlin. String template is a feature in Kotlin where we the syntax is "$variable "
But then also prefer Kotlin instead of Java because of less code and much more features 😅😅😎😎

abhinavkumar
Автор

But textblocks were featured in java 17?

Asingh
Автор

This feature is long back ago in python

LetsClarifyIt
Автор

I didn't like backslash \{} they could have used ${}, or {{}}..

zabiullah
Автор

If mojo came out than just forget other languages python will be king

LetsClarifyIt
Автор

Python and JavaScript developers laughing from the corner😅😂😂

mareboinaravi
Автор

Looks ugly, hope they will change it before official release. It should be like in C#:
$"{a} + {b} = {a + b}"

cvetkovicslobodan
Автор

For your usecase printf() is a better solution than string template

System.out.printf("%d + %d = %d", a, b, a+b);

Any thoughts ?

bibhusvibe