Java 8 Virtual Training - 01st - 03rd February 2023

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

Java 8 Virtual Training | 01st – 03rd


February 2023
Dear Colleague,                                                                                                                 
                                                              
Thank you for attending the session, we have scheduled a post training
assessment on Java 8 Virtual Training.

Instructions
1) All the questions are mandatory.
2) Each question will carry 1 Mark.
3) Assessment duration will be 25min.
4) Single attempt is allowed.
5) Training certificate will be awarded to those who clear the assessment with 70% and
more.

1. EMP ID *

32128

2. Name *

Kammara jagadeesachari

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 1/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

3. Email ID

Jagadesachari.K@synechron.com

4. Which is new command line tool for the Nashhorn JavaScript engine in java 8 ?
* (1 Point)

jcs

jfs

jjs 

jss

5. How many abstract  methods we can declare in functional interface * (1 Point)

1 

6.  The newly introduced Streams API is available in which package of java 8, *


(1 Point)

java.io.streams

java.io.stream

java.util.stream 
java.util.streams

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 2/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

7. PermGen space has been replaced with which of these in Java 8 * (1 Point)

PermSpace

Metaspace 

MetaGenSpace

None of the above

8. Streams are constructed * (1 Point)

Eagerly

Lazily 

9.  Streams are used to store and group the data in a particular data structure.
True or false * (1 Point)

True

False 

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 3/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

10. class DemoLambdaExpression

public static void main(String []args)

int x=20;

Runnable r =()->{ System.out.println("Running with value:-"+x); }; x=200;

Thread t=new Thread(r); t.start();

What will be the output of the code above? * (1 Point)

Running with value :- 200

Nothing will be displayed on console

The code will not compile 

None of the above

11. Which of the following tag is introduced to set the size of metaspace? *
(1 Point)

 -XX:Metaspace

 -XX:MetaspaceSize 
-XX:MinMetaspaceSize

-XX:MetaSSize

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 4/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

12. In java 8 Function is ? * (1 Point)

Class

Function

Interface 

Lambda expression

13. Which of the following can be used to avoid NullpointerExceptions and null
checks in Java 8? * (1 Point)

NotNull

NotRequired

Required

Optional 

14. What type of methods we can declare in Java 8 interfaces? * (1 Point)

Abstract methods

Default methods

All of the above 


None of the above

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 5/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

15. Which of the following interface is introduced in JDK 8 enabling creation and
execution of the chains of asynchronous tasks? * (1 Point)

 Future

CompletableFuture 

Callable

None of the above

16. Which one of the following enables improving the sorting speed significantly on
multi-core machines? * (1 Point)

Arrays.sort

Collection.parallelSort

Arrays.sortParallelly

Arrays.parallelSort 

17. On compilation of the following code, what will be the output? * (1 Point)

The code will be compiled successfully

The code will give compilation error 


None of the above

18.  Which of the following has the method signature as R apply(T t) * (1 Point)

Function 

Predicate

BiPredicate

None of the above

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 6/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

19. Observe the lambada expressions below,

1.      () -> System.out.println("Zero parameter lambda");

2.      (param) -> System.out.println("One parameter: " + param);

3.      (param1, param2) -> System.out.println("Multiple parameters: " +


param1 + ", "

+ param2);

4.      (param1, param2) -> System.out.println("Multiple parameters: " +


param1 + ", "

+ param2);
Which of the above are valid lambda expressions? * (1 Point)

1,2,4

1,2,3

All of the above 


None of the above

20. Which of the operations the Streams allows us to perform ? * (1 Point)

Add data

Modify the data 


Remove the data

None of the above

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 7/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

21. Nashorn the new JavaScript engine is an implementation of * (1 Point)

javax.script.ScriptEngine 
javax.javaScript.ScriptEngine

javax.engine.ScriptEngine

Ojavax.engine.Engine

22. Which of the following iterational mechanism stream supports * (1 Point)

External iteration

Internal iteration 
All of the above

None of the above

23. Lambda expressions in java 8 are based on * (1 Point)

Object oriented programming

Functional programming 
Procedural programming

None of the above

24.  jcmd utility is introduced for * (1 Point)

diagnosing the problems related to JVM and Java applications 


printing memory related statistics

providing information about performance

 none of the above

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 8/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

25. On execution of the of following, what will be the output?

 Optional<String> emptyGender = Optional.empty();

emptyGender.ifPresent(g -> System.out.println("In emptyGender Option, value


available.")); * (1 Point)

Nothing will be printed on console 


In emptyGender Option, value available

Exception will be thrown

None of the above

26. 10.  Lambda expressions are -------- scoped * (1 Point)

Binary

Lexically 
Semantically

None of the above

27.  Which of these should be used to show package-level and class-level


dependencies of Class files in Java 8 * (1 Point)

deps

ideps

jdep

jdeps 

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 9/10
04/02/2023, 18:24 Java 8 Virtual Training | 01st – 03rd February 2023

28. “A developer is free to add default methods to your functional interface as


many as you like”. True or False? * (1 Point)

True 

False

This content is created by the owner of the form. The data you submit will be sent to the form owner. Microsoft is
not responsible for the privacy or security practices of its customers, including those of this form owner. Never give
out your password.

Powered by Microsoft Forms | Privacy and cookies | Terms of use

https://forms.office.com/pages/responsepage.aspx?id=hLwO5fJ2Nka1UMP3q8kkr0vF8_MbrJdKhjctrynn6yFUNVVSU0ZCTDNCMUtORE9MQTNYWVhH… 10/10

You might also like