Translate

Friday 1 October 2021

String in Groovy Scripting groovy training telugu 18

 Watch This Video

https://youtu.be/c6yD_o6Q8A0

-----------------------------------------------------------------------------------------------


//java

char c='h'
c.class


String a="hello"
a.class


//Groovy

def x='c'
x.class

def r='hello'
r.class

// String interpolation

String name="rashmi"
String msg="Hello"+name+"...."
println(msg)

String msg1="Hello ${name}"
println (msg1)

String msg2="Hello ${name}"
println (msg2)

String msg3="we can evaulate expression here: ${1+1}"
println(msg3)


//multiline String

def k='''
A
Msg
goes
here
and 
keeps going
'''

println a











No comments:

Post a Comment

Note: only a member of this blog may post a comment.