
Java Interview Guide : 200+ Interview Questions and Answers - What is Cohesion?
Interactive Video
•
Information Technology (IT), Architecture
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Read more
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does cohesion in a class refer to?
How related the responsibilities of a class are
The speed at which a class executes
The amount of data a class can handle
The number of methods in a class
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why is the 'download and store' class considered to have low cohesion?
It is too complex to understand
It has too few methods
It uses too many external libraries
It handles multiple unrelated responsibilities
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a responsibility of the 'download and store' class?
Storing data into a database
Parsing data
Rendering data on a webpage
Downloading data from the Internet
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can cohesion be improved in the 'download and store' example?
By reducing the number of lines of code
By splitting responsibilities into separate classes
By adding more methods to the class
By using a different programming language
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main responsibility of the 'Internet downloader' class?
Rendering data on a webpage
Downloading data from the Internet
Storing data into a database
Parsing data
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the benefit of having a 'database storer' class?
It can handle multiple types of databases
It focuses solely on storing data into a database
It can parse and store data simultaneously
It reduces the need for a database
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the role of the 'download and store' class in a high cohesion design?
To parse data from the Internet
To directly interact with the database
To create instances of other classes and coordinate their actions
To handle all responsibilities related to data processing
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?