Apache Groovy/Groovy MCQ Sample Test,Sample questions

Question:
 Explain GroovyDoc comment?

1.Type definitions (classes, interfaces, enums, annotations)

2.Fields and properties definitions

3.Methods definitions

4.All the above

Posted Date:-2022-11-10 22:19:14


Question:
 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

Posted Date:-2022-11-10 23:19:04


Question:
 What does JVM stand for?

1. Java Value-based Machine

2.Java Virtual Machine

3.JavaScript Virtual Machine

4.JavaScript Value-based Machine

Posted Date:-2022-11-10 23:05:43


Question:
. 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

Posted Date:-2022-11-10 22:49:21


Question:
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

Posted Date:-2022-11-10 23:27:40


Question:
AST in Groovy can be built from

1.Strings

2.Codes

3.DSL

4.All of the above

Posted Date:-2022-11-10 23:02:27


Question:
AST in Groovy can be built from…

1.Strings

2.Codes

3.DSL

4.None of These

Posted Date:-2022-11-10 23:23:42


Question:
Following the assignment def x = 2/3; what it the type of variable x?

1.Integer

2.Rational

3.BigInteger

4.BigDecimal

Posted Date:-2022-11-10 23:07:27


Question:
Groovy can be used as a scripting language.

1.False

2.True

3.Error

4.None of These

Posted Date:-2022-11-10 23:21:31


Question:
Groovy can be used as a scripting language.

1.False

2.True

3.Error

4.None of These

Posted Date:-2022-11-10 23:21:31


Question:
Groovy does not require…

1.Large memory

2.Java knowledge

3.Syntaxes

4.Class declaration

Posted Date:-2022-11-11 01:35:28


Question:
Groovy is

1.Dynamically typed language

2.Statically typed language

3.Optionally typed (Both dynamic and static)

4.None of these

Posted Date:-2022-11-10 23:18:09


Question:
Groovy is a high-level language


1.True

2.False

3.Error

4.Can not say

Posted Date:-2022-11-10 23:16:36


Question:
Groovy is an object oriented programming language for

1. JVM

2.HTML

3.PHP

4.Python

Posted Date:-2022-11-10 23:26:49


Question:
Groovy is based on

1.Java

2.JavaScript

3.Python

4.Ruby

Posted Date:-2022-11-10 23:15:06


Question:
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

Posted Date:-2022-11-10 23:01:38


Question:
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

Posted Date:-2022-11-10 22:17:47


Question:
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

Posted Date:-2022-11-11 01:39:01


Question:
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

Posted Date:-2022-11-10 22:16:21


Question:
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

Posted Date:-2022-11-10 22:58:08


Question:
How to use single line comments in groovy

1. // comment

2.# comment

3. $ comment

4.All of the above

Posted Date:-2022-11-11 01:42:20


Question:
In groovy all methods and classes are--------------by default
A. 
B. 
C. 

1.Private

2.Public

3.Protected

4.None

Posted Date:-2022-11-10 23:22:58


Question:
In Groovy map, each element will be mapped to a
A. 
B. 
C. 

1.ID

2.Value

3.Key

4.None of These

Posted Date:-2022-11-10 23:20:39


Question:
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

Posted Date:-2022-11-10 22:54:02


Question:
What are Bitwise Operators in Groovy?

1.bitwise and"

2. I : bitwise or"

3.A : bitwise xor"

4.~ : bitwise negation

Posted Date:-2022-11-10 22:51:41


Question:
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

Posted Date:-2022-11-10 22:56:33


Question:
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

Posted Date:-2022-11-10 23:00:30


Question:
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

Posted Date:-2022-11-10 22:59:21


Question:
What is Groovydoc Comment?

1.Type definitions (classes, interfaces, enums, annotations)

2.Fields and properties definitions

3.Methods definitions

4.All of the above

Posted Date:-2022-11-10 23:03:32


Question:
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

Posted Date:-2022-11-11 01:41:19


Question:
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

Posted Date:-2022-11-10 22:12:34


Question:
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

Posted Date:-2022-11-11 01:36:47


Question:
What term do you use in Groovy to declare a function outside a class?

1. Div

2.Class

3.Def

4.Function

Posted Date:-2022-11-10 23:39:01


Question:
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

Posted Date:-2022-11-10 23:22:09


Question:
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

Posted Date:-2022-11-10 23:24:37


Question:
Which tool provides a GUI for writing simple Groovy programs?

1.Groovysh

2.GroovyConsole

3.Groovy

4.None

Posted Date:-2022-11-10 23:08:34


Question:
Which tool provides a GUI for writing simple Groovy programs?

1.Groovysh

2.GroovyConsole

3.Groovycorrect

4.Nonewrong

Posted Date:-2022-11-10 23:13:58


Question:
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

Posted Date:-2022-11-10 22:52:58


Question:
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

Posted Date:-2022-11-10 22:14:46


More MCQS

  1. Groovy MCQ
  2. Groovy. MCQ
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!