Translate

Friday, 1 October 2021

Numbers in GroovyScripting groovy training videos in telugu 07

 Watch This Video

https://youtu.be/IXhCHKWaQFQ

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

// in java we represent number variable

int a=1;
float g=5.5f
byte
double


// in groovy

1.getClass().getName()
'rashmi'.getClass().getName()

x=1
x.class


def x=1.5
x.class

def x=1.5d
x.class

Assertions in Groovy Scripting groovy training videos in telugu 06

 Watch This Video

https://youtu.be/p-hDIIZUR1k



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


assert one expression ==onother expression

assert true
assert 1==1


//like the example above we are evaluating an expression

def x=1

assert x==1

//what happens when the expression doesnot evaluate to true

assert false

assert 1==2


//complex debug output

assert 1==(3+10)*100/5*20



//calc

def x=2
def y=7
def z=5

def calc ={a,b -> a*b+1}

assert calc(x,y)==z*z:'incorrect computation result'




Commenting Code in Groovy Scripting groovy trainig in telugu 05

 Watch This Video

https://youtu.be/573NoyfjgUY


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

http://groovy-lang.org/syntax.html#_single_line_comment


Java:
single line comment-  //

double line comment-  /*    */



Groovy
Single-line comment
// a standalone single line comment
println "hello" // a comment till the end of the line
Multiline comment

/* a standalone multiline comment
   spanning two lines */




Keywords in Groovy Scripting groovy training videos in telugu 04

 Watch This Video

https://youtu.be/88KF5cmHtZ4




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

//Java
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html


example:

abstract
continue
for
new
switch
assert***
default goto*
package
synchronized
boolean

//Groovy

http://groovy-lang.org/syntax.html#_keywords

example:

as
assert
break
case
catch
class
const
continue
def
for
in
null









What are Packages in Groovy Scripting groovy training videos in telugu 03

 Watch This Video

https://youtu.be/VSASuDkvwHA

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

http://groovy-lang.org/structure.html#_default_imports



2.1. Default imports
2.2. Simple import
2.3. Star import
2.4. Static import
2.5. Static import aliasing
2.7. Import aliasing