36.Stub Void Methods Explicitly

36.Stub Void Methods Explicitly

Professional Development

27 Qs

quiz-placeholder

Similar activities

Final Coaching - Professional Education

Final Coaching - Professional Education

Professional Development

28 Qs

11.8.2021

11.8.2021

Professional Development

30 Qs

Elimination

Elimination

Professional Development

23 Qs

DATA TYPES ,INPUT AND OUTPUT

DATA TYPES ,INPUT AND OUTPUT

Professional Development

25 Qs

Programação Orientada a Objetos - Introdução

Programação Orientada a Objetos - Introdução

1st Grade - Professional Development

30 Qs

FUNCTIONS - FILES - MODULES - OOPS

FUNCTIONS - FILES - MODULES - OOPS

Professional Development

25 Qs

Welcome to quiz for Paper 2

Welcome to quiz for Paper 2

Professional Development

24 Qs

Motor Control- 8 Reversing Motor Controls

Motor Control- 8 Reversing Motor Controls

Professional Development

25 Qs

36.Stub Void Methods Explicitly

36.Stub Void Methods Explicitly

Assessment

Quiz

Professional Development

Professional Development

Hard

Created by

ANIL KUMAR

FREE Resource

27 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How do you stub a method that returns void?
Mockito's doNothing()
Custom stub implementation
Use a mocking framework
Void methods cannot be stubbed

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What are void methods and return methods in Java?
Void: no return value
Return: returns a value
Only void methods exist
Both void and return methods are the same

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is void vs return method in Java?
Void: no return value
Return: has a return value
Void is a return type
Return methods are deprecated

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How to pass a void method in Java?
Simply call the method
Cannot pass void methods
Convert void method to a return method
Use a wrapper class to pass void methods

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How to convert void method to boolean in Java?
Not possible, void methods have no return value.
Modify the method to return a boolean value.
Use exception handling to return a boolean indicating success or failure.
Wrap the void method in a separate method that returns a boolean.

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is return in Java?
A keyword used to terminate a loop or method.
A statement that specifies the value to be returned from a method.
An access modifier indicating the visibility of a class member.
A reserved keyword with no specific purpose in Java.

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Can we test void methods?
Yes, we can test void methods.
No, void methods cannot be tested.
Testing void methods is unnecessary.
Void methods are automatically tested.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?

Discover more resources for Professional Development