Explain GroovyDoc comment?
1.Type definitions (classes, interfaces, enums, annotations)
2.Fields and properties definitions
3.Methods definitions
4.All the above
In static programming languages
1.type checking happens at run time
2. type checking happens at compile time
3.both (a) and (b)
4.None of These
What does JVM stand for?
1. Java Value-based Machine
2.Java Virtual Machine
3.JavaScript Virtual Machine
4.JavaScript Value-based Machine
. Why Use Groovy?
1.For Java programmers it provides familiar syntax
2.It has a rich stock of Java Libraries
3.It easily integrate with your existing infrastructure like Servlet Containers, App Servers, Loads of databases with JDBC drivers
4.All the above
All of the following are uses of Groovy except…
1.To combine Java modules
2.To write Java application
3.To extend existing Java applications
4.To execute Java applications
AST in Groovy can be built from
1.Strings
2.Codes
3.DSL
4.All of the above
AST in Groovy can be built from…
1.Strings
2.Codes
3.DSL
4.None of These
Following the assignment def x = 2/3; what it the type of variable x?
1.Integer
2.Rational
3.BigInteger
4.BigDecimal
Groovy can be used as a scripting language.
1.False
2.True
3.Error
4.None of These
Groovy does not require…
1.Large memory
2.Java knowledge
3.Syntaxes
4.Class declaration
Groovy is
1.Dynamically typed language
2.Statically typed language
3.Optionally typed (Both dynamic and static)
4.None of these
Groovy is a high-level language
1.True
2.False
3.Error
4.Can not say
Groovy is an object oriented programming language for
1. JVM
2.HTML
3.PHP
4.Python
Groovy is based on
1.Java
2.JavaScript
3.Python
4.Ruby
How can we build AST (Abstract Syntax Trees) in Groovy from a string?
1.Strings
2.Code
3.From DSL like specification
4.All of these
How can we build AST (Abstract Syntax Trees) in Groovy from string?
1.Strings
2.Code
3.From DSL like specification
4.All of the above
How can we build AST (Abstract Syntax Trees) in Groovy from string?
1.Strings
2.Code
3.From DSL like specification
4.All of the above
How Groovy string is expressed?
1.It is surrounded by double quotes, for regular strings it uses single quotes
2.It may contain Groovy Expressions noted in ${}
3.Square bracket syntax may be applied like charAt(i)
4.All of these
How Is Groovy string expressed?
1.It is surrounded by double quotes, for regular strings it uses single quotes
2.It may contain Groovy Expressions noted in ${}
3.Square bracket syntax may be applied like charAt(i)
4.All of the above
How to use single line comments in groovy
1. // comment
2.# comment
3. $ comment
4.All of the above
In groovy all methods and classes are--------------by default A. B. C.
1.Private
2.Public
3.Protected
4.None
In Groovy map, each element will be mapped to a A. B. C.
1.ID
2.Value
3.Key
4.None of These
Mention the features offered by groovy JDK.
1.The collection of literals. The literal syntax and its initialization are natural and highly readable unlike java in which they are cumbersome and unpleasant.
2.The Groovy Beans property. Although Java is based on the concept of JavaBeans as a structure, still it lacks a direct syntactic support. Whereas, groovy can declare a field as a property as trivial an
3.This feature was presented in groovy since its first release especially in the collection framework.
4.All of these
What are Bitwise Operators in Groovy?
1.bitwise and"
2. I : bitwise or"
3.A : bitwise xor"
4.~ : bitwise negation
What are the advantages of groovy?
1.Operator overloading is also possible in this
2.Maps, arrays, ranges, and regular expressions can be literally declared
3.It possesses efficient object navigation
4.All of the above
What are the features of groovy JDK?
1.This feature was presented in groovy since its first release especially in the collection framework
2.GDK enhancements. Many operators for many of the classes and various additional methods have also been introduced by groovy
3. Both of these
4.none of these
What are the limitations of Groovy?
1. For using groovy, you need to have enough knowledge of Java. Knowledge of Java is important because half of groovy is based on Java
2. It might take you some time to get used to the usual syntax and default typing
3.It consists of thin documentation
4.All of the above
What is Groovydoc Comment?
1.Type definitions (classes, interfaces, enums, annotations)
2.Fields and properties definitions
3.Methods definitions
4.All of the above
What is the command to run a groovy file from the command line
1.groovy “location of file”
2.groovy run “location of file”
3.both (a) and (b)
4.None of these
What is the limitation of Groovy?
1. Groovy can be slower
2.Groovy might need lots of memory
3.Groovy start up time requires improvement
4.All of the above
What is the limitation of Groovy?
1.Groovy can be slower
2.Groovy might need lots of memory
3.Groovy start up time requires improvement
4.All of the above
What term do you use in Groovy to declare a function outside a class?
1. Div
2.Class
3.Def
4.Function
What will be the output for the following code? def example = 1..100 println(example.getTo())
1.1
2.99
3.100
4.None of these
Which of the following is a reason why programmers use Groovy?
1.It is fast and easy
2.It requires a small portion of memory
3.Documentation is thin
4.Operators can be overloaded
Which tool provides a GUI for writing simple Groovy programs?
1.Groovysh
2.GroovyConsole
3.Groovy
4.None
Which tool provides a GUI for writing simple Groovy programs?
1.Groovysh
2.GroovyConsole
3.Groovycorrect
4.Nonewrong
You write a web application and build it by the Gradle build tool. When you see all Gradle tasks, there isn't task 'war'. What a problem may it be?
1.You forget to set plugin 'jar' in build.xml
2.You forget to set plugin 'war' in build.gradle
3.you forget to set plugin 'web' in build.gradle
4.You forget to set plugin 'war' in web.xml
You write a web application with groovlets. You need to get parameter of the request with name 'age' in your script. What is the best way to do this?
1.def age = params.age ?: 0
2. def age = params.age ? params.age : 0
3.def age = params.name == 'age' ? params.age : "not found"
4.def age = params.getAge